Merge branch '3.2.x'

This commit is contained in:
Marc Alexander 2017-01-02 22:55:25 +01:00
commit b5ad21debc
No known key found for this signature in database
GPG key ID: 50E0D2423696F995
5 changed files with 68 additions and 62 deletions

View file

@ -55,7 +55,7 @@
"laravel/homestead": "~3.0", "laravel/homestead": "~3.0",
"phing/phing": "2.4.*", "phing/phing": "2.4.*",
"phpunit/dbunit": "~2.0", "phpunit/dbunit": "~2.0",
"phpunit/phpunit": "~4.8", "phpunit/phpunit": "^4.1",
"squizlabs/php_codesniffer": "2.*", "squizlabs/php_codesniffer": "2.*",
"symfony/browser-kit": "~3.1", "symfony/browser-kit": "~3.1",
"symfony/css-selector": "~3.1", "symfony/css-selector": "~3.1",

38
phpBB/composer.lock generated
View file

@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "ea466b63c18f25962d5e2740543e71f2", "hash": "71da80ba275535787acd4570ccc0627c",
"content-hash": "dca7df02f1926577c88439cb709013b6", "content-hash": "3de4cd17b0e17d6e273ef2b6e16631ad",
"packages": [ "packages": [
{ {
"name": "bantu/ini-get-wrapper", "name": "bantu/ini-get-wrapper",
@ -2027,32 +2027,37 @@
}, },
{ {
"name": "phpdocumentor/reflection-docblock", "name": "phpdocumentor/reflection-docblock",
"version": "3.1.1", "version": "2.0.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8",
"reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.5", "php": ">=5.3.3"
"phpdocumentor/reflection-common": "^1.0@dev",
"phpdocumentor/type-resolver": "^0.2.0",
"webmozart/assert": "^1.0"
}, },
"require-dev": { "require-dev": {
"mockery/mockery": "^0.9.4", "phpunit/phpunit": "~4.0"
"phpunit/phpunit": "^4.4" },
"suggest": {
"dflydev/markdown": "~1.0",
"erusev/parsedown": "~1.0"
}, },
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": { "autoload": {
"psr-4": { "psr-0": {
"phpDocumentor\\Reflection\\": [ "phpDocumentor": [
"src/" "src/"
] ]
} }
@ -2064,11 +2069,10 @@
"authors": [ "authors": [
{ {
"name": "Mike van Riel", "name": "Mike van Riel",
"email": "me@mikevanriel.com" "email": "mike.vanriel@naenius.com"
} }
], ],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "time": "2015-02-03 12:10:50"
"time": "2016-09-30 07:12:33"
}, },
{ {
"name": "phpdocumentor/type-resolver", "name": "phpdocumentor/type-resolver",

View file

@ -78,15 +78,12 @@ class phpbb_ui_test_case extends phpbb_test_case
self::markTestSkipped('phpbb_functional_url was not set in test_config and wasn\'t set as PHPBB_FUNCTIONAL_URL environment variable either.'); self::markTestSkipped('phpbb_functional_url was not set in test_config and wasn\'t set as PHPBB_FUNCTIONAL_URL environment variable either.');
} }
if (!self::$webDriver)
{
try { try {
$capabilities = DesiredCapabilities::firefox(); $capabilities = DesiredCapabilities::firefox();
self::$webDriver = RemoteWebDriver::create(self::$host . ':' . self::$port, $capabilities); self::$webDriver = RemoteWebDriver::create(self::$host . ':' . self::$port, $capabilities);
} catch (WebDriverCurlException $e) { } catch (WebDriverCurlException $e) {
self::markTestSkipped('PhantomJS webserver is not running.'); self::markTestSkipped('PhantomJS webserver is not running.');
} }
}
if (!self::$already_installed) if (!self::$already_installed)
{ {
@ -146,9 +143,14 @@ class phpbb_ui_test_case extends phpbb_test_case
} }
} }
static public function visit($path) public function getDriver()
{ {
self::$webDriver->get(self::$root_url . $path); return self::$webDriver;
}
public function visit($path)
{
$this->getDriver()->get(self::$root_url . $path);
} }
static protected function recreate_database($config) static protected function recreate_database($config)
@ -157,14 +159,14 @@ class phpbb_ui_test_case extends phpbb_test_case
$db_conn_mgr->recreate_db(); $db_conn_mgr->recreate_db();
} }
static public function find_element($type, $value) public function find_element($type, $value)
{ {
return self::$webDriver->findElement(WebDriverBy::$type($value)); return $this->getDriver()->findElement(WebDriverBy::$type($value));
} }
static public function submit($type = 'id', $value = 'submit') public function submit($type = 'id', $value = 'submit')
{ {
$element = self::find_element($type, $value); $element = $this->find_element($type, $value);
$element->click(); $element->click();
} }
@ -305,21 +307,21 @@ class phpbb_ui_test_case extends phpbb_test_case
$ext_path = str_replace('/', '%2F', $extension); $ext_path = str_replace('/', '%2F', $extension);
$this->visit('adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=' . $ext_path . '&sid=' . $this->sid); $this->visit('adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=' . $ext_path . '&sid=' . $this->sid);
$this->assertNotEmpty(count(self::find_element('cssSelector', '.submit-buttons'))); $this->assertNotEmpty(count($this->find_element('cssSelector', '.submit-buttons')));
self::find_element('cssSelector', "input[value='Enable']")->submit(); $this->find_element('cssSelector', "input[value='Enable']")->submit();
$this->add_lang('acp/extensions'); $this->add_lang('acp/extensions');
try try
{ {
$meta_refresh = self::find_element('cssSelector', 'meta[http-equiv="refresh"]'); $meta_refresh = $this->find_element('cssSelector', 'meta[http-equiv="refresh"]');
// Wait for extension to be fully enabled // Wait for extension to be fully enabled
while (sizeof($meta_refresh)) while (sizeof($meta_refresh))
{ {
preg_match('#url=.+/(adm+.+)#', $meta_refresh->getAttribute('content'), $match); preg_match('#url=.+/(adm+.+)#', $meta_refresh->getAttribute('content'), $match);
self::$webDriver->execute(array('method' => 'post', 'url' => $match[1])); $this->getDriver()->execute(array('method' => 'post', 'url' => $match[1]));
$meta_refresh = self::find_element('cssSelector', 'meta[http-equiv="refresh"]'); $meta_refresh = $this->find_element('cssSelector', 'meta[http-equiv="refresh"]');
} }
} }
catch (\Facebook\WebDriver\Exception\NoSuchElementException $e) catch (\Facebook\WebDriver\Exception\NoSuchElementException $e)
@ -327,7 +329,7 @@ class phpbb_ui_test_case extends phpbb_test_case
// Probably no refresh triggered // Probably no refresh triggered
} }
$this->assertContainsLang('EXTENSION_ENABLE_SUCCESS', self::find_element('cssSelector', 'div.successbox')->getText()); $this->assertContainsLang('EXTENSION_ENABLE_SUCCESS', $this->find_element('cssSelector', 'div.successbox')->getText());
$this->logout(); $this->logout();
} }
@ -415,7 +417,7 @@ class phpbb_ui_test_case extends phpbb_test_case
} }
$this->visit('ucp.php?sid=' . $this->sid . '&mode=logout'); $this->visit('ucp.php?sid=' . $this->sid . '&mode=logout');
$this->assertContains($this->lang('REGISTER'), self::$webDriver->getPageSource()); $this->assertContains($this->lang('REGISTER'), $this->getDriver()->getPageSource());
unset($this->sid); unset($this->sid);
} }
@ -435,17 +437,17 @@ class phpbb_ui_test_case extends phpbb_test_case
return; return;
} }
self::$webDriver->manage()->deleteAllCookies(); $this->getDriver()->manage()->deleteAllCookies();
$this->visit('adm/index.php?sid=' . $this->sid); $this->visit('adm/index.php?sid=' . $this->sid);
$this->assertContains($this->lang('LOGIN_ADMIN_CONFIRM'), self::$webDriver->getPageSource()); $this->assertContains($this->lang('LOGIN_ADMIN_CONFIRM'), $this->getDriver()->getPageSource());
self::find_element('cssSelector', 'input[name=username]')->clear()->sendKeys($username); $this->find_element('cssSelector', 'input[name=username]')->clear()->sendKeys($username);
self::find_element('cssSelector', 'input[type=password]')->sendKeys($username . $username); $this->find_element('cssSelector', 'input[type=password]')->sendKeys($username . $username);
self::find_element('cssSelector', 'input[name=login]')->click(); $this->find_element('cssSelector', 'input[name=login]')->click();
$this->assertContains($this->lang('ADMIN_PANEL'), $this->find_element('cssSelector', 'h1')->getText()); $this->assertContains($this->lang('ADMIN_PANEL'), $this->find_element('cssSelector', 'h1')->getText());
$cookies = self::$webDriver->manage()->getCookies(); $cookies = $this->getDriver()->manage()->getCookies();
// The session id is stored in a cookie that ends with _sid - we assume there is only one such cookie // The session id is stored in a cookie that ends with _sid - we assume there is only one such cookie
foreach ($cookies as $cookie) foreach ($cookies as $cookie)
@ -550,19 +552,19 @@ class phpbb_ui_test_case extends phpbb_test_case
{ {
$this->add_lang('ucp'); $this->add_lang('ucp');
self::$webDriver->manage()->deleteAllCookies(); $this->getDriver()->manage()->deleteAllCookies();
$this->visit('ucp.php'); $this->visit('ucp.php');
$this->assertContains($this->lang('LOGIN_EXPLAIN_UCP'), self::$webDriver->getPageSource()); $this->assertContains($this->lang('LOGIN_EXPLAIN_UCP'), $this->getDriver()->getPageSource());
self::$webDriver->manage()->deleteAllCookies(); $this->getDriver()->manage()->deleteAllCookies();
self::find_element('cssSelector', 'input[name=username]')->sendKeys($username); $this->find_element('cssSelector', 'input[name=username]')->sendKeys($username);
self::find_element('cssSelector', 'input[name=password]')->sendKeys($username . $username); $this->find_element('cssSelector', 'input[name=password]')->sendKeys($username . $username);
self::find_element('cssSelector', 'input[name=login]')->click(); $this->find_element('cssSelector', 'input[name=login]')->click();
$this->assertNotContains($this->lang('LOGIN'), $this->find_element('className', 'navbar')->getText()); $this->assertNotContains($this->lang('LOGIN'), $this->find_element('className', 'navbar')->getText());
$cookies = self::$webDriver->manage()->getCookies(); $cookies = $this->getDriver()->manage()->getCookies();
// The session id is stored in a cookie that ends with _sid - we assume there is only one such cookie // The session id is stored in a cookie that ends with _sid - we assume there is only one such cookie
foreach ($cookies as $cookie) foreach ($cookies as $cookie)
@ -586,6 +588,6 @@ class phpbb_ui_test_case extends phpbb_test_case
// Change the Path to your own settings // Change the Path to your own settings
$screenshot = time() . ".png"; $screenshot = time() . ".png";
self::$webDriver->takeScreenshot($screenshot); $this->getDriver()->takeScreenshot($screenshot);
} }
} }

View file

@ -25,19 +25,19 @@ class ui_permission_roles_test extends phpbb_ui_test_case
$this->visit('adm/index.php?i=acp_permissions&mode=setting_forum_local&sid=' . $this->sid); $this->visit('adm/index.php?i=acp_permissions&mode=setting_forum_local&sid=' . $this->sid);
// Select forums // Select forums
$elements = self::find_element('cssSelector', 'select#forum') $elements = $this->find_element('cssSelector', 'select#forum')
->findElements(\Facebook\WebDriver\WebDriverBy::tagName('option')); ->findElements(\Facebook\WebDriver\WebDriverBy::tagName('option'));
foreach ($elements as $element) foreach ($elements as $element)
{ {
$element->click(); $element->click();
} }
self::find_element('cssSelector', 'form#select_victim') $this->find_element('cssSelector', 'form#select_victim')
->findElement(\Facebook\WebDriver\WebDriverBy::cssSelector('input[type=submit]')) ->findElement(\Facebook\WebDriver\WebDriverBy::cssSelector('input[type=submit]'))
->click(); ->click();
// Select administrators and guests // Select administrators and guests
$groups_form = self::find_element('cssSelector', 'form#groups'); $groups_form = $this->find_element('cssSelector', 'form#groups');
$elements = $groups_form $elements = $groups_form
->findElement(\Facebook\WebDriver\WebDriverBy::cssSelector('select')) ->findElement(\Facebook\WebDriver\WebDriverBy::cssSelector('select'))
->findElements(\Facebook\WebDriver\WebDriverBy::tagName('option')); ->findElements(\Facebook\WebDriver\WebDriverBy::tagName('option'));
@ -51,7 +51,7 @@ class ui_permission_roles_test extends phpbb_ui_test_case
} }
$groups_form->findElement(\Facebook\WebDriver\WebDriverBy::cssSelector('input[name=submit_edit_options]'))->click(); $groups_form->findElement(\Facebook\WebDriver\WebDriverBy::cssSelector('input[name=submit_edit_options]'))->click();
$first_fieldset = self::find_element('cssSelector', '#perm11'); $first_fieldset = $this->find_element('cssSelector', '#perm11');
$this->assertEquals('none', $first_fieldset->findElement(\Facebook\WebDriver\WebDriverBy::cssSelector('div.dropdown'))->getCSSValue('display')); $this->assertEquals('none', $first_fieldset->findElement(\Facebook\WebDriver\WebDriverBy::cssSelector('div.dropdown'))->getCSSValue('display'));
$first_fieldset $first_fieldset
->findElement(\Facebook\WebDriver\WebDriverBy::cssSelector('span.dropdown-toggle')) ->findElement(\Facebook\WebDriver\WebDriverBy::cssSelector('span.dropdown-toggle'))
@ -74,14 +74,14 @@ class ui_permission_roles_test extends phpbb_ui_test_case
$this->assertEquals($this->lang('ROLE_FORUM_LIMITED'), $first_fieldset->findElement(\Facebook\WebDriver\WebDriverBy::cssSelector('span.dropdown-toggle'))->getText()); $this->assertEquals($this->lang('ROLE_FORUM_LIMITED'), $first_fieldset->findElement(\Facebook\WebDriver\WebDriverBy::cssSelector('span.dropdown-toggle'))->getText());
// Check that admin settings didn't get changed // Check that admin settings didn't get changed
$second_fieldset = self::find_element('cssSelector', '#perm10'); $second_fieldset = $this->find_element('cssSelector', '#perm10');
$this->assertEquals('none', $second_fieldset->findElement(\Facebook\WebDriver\WebDriverBy::cssSelector('div.dropdown'))->getCSSValue('display')); $this->assertEquals('none', $second_fieldset->findElement(\Facebook\WebDriver\WebDriverBy::cssSelector('div.dropdown'))->getCSSValue('display'));
// Full access = 14 // Full access = 14
$this->assertEquals(14, $second_fieldset->findElement(\Facebook\WebDriver\WebDriverBy::cssSelector('input[type=hidden]'))->getAttribute('value')); $this->assertEquals(14, $second_fieldset->findElement(\Facebook\WebDriver\WebDriverBy::cssSelector('input[type=hidden]'))->getAttribute('value'));
$this->assertEquals($this->lang('ROLE_FORUM_FULL'), $second_fieldset->findElement(\Facebook\WebDriver\WebDriverBy::cssSelector('span.dropdown-toggle'))->getText()); $this->assertEquals($this->lang('ROLE_FORUM_FULL'), $second_fieldset->findElement(\Facebook\WebDriver\WebDriverBy::cssSelector('span.dropdown-toggle'))->getText());
// Check that category settings were not modified // Check that category settings were not modified
$category_fieldset = self::find_element('cssSelector', '#perm00'); $category_fieldset = $this->find_element('cssSelector', '#perm00');
$this->assertEquals('none', $category_fieldset->findElement(\Facebook\WebDriver\WebDriverBy::cssSelector('div.dropdown'))->getCSSValue('display')); $this->assertEquals('none', $category_fieldset->findElement(\Facebook\WebDriver\WebDriverBy::cssSelector('div.dropdown'))->getCSSValue('display'));
// No settings // No settings
$this->assertEquals('', $category_fieldset->findElement(\Facebook\WebDriver\WebDriverBy::cssSelector('input[type=hidden]'))->getAttribute('value')); $this->assertEquals('', $category_fieldset->findElement(\Facebook\WebDriver\WebDriverBy::cssSelector('input[type=hidden]'))->getAttribute('value'));

View file

@ -19,8 +19,8 @@ class quick_links_test extends phpbb_ui_test_case
public function test_quick_links() public function test_quick_links()
{ {
$this->visit('index.php'); $this->visit('index.php');
$this->assertEmpty(self::find_element('className', 'dropdown')->getText()); $this->assertEmpty($this->find_element('className', 'dropdown')->getText());
self::find_element('className', 'dropdown-toggle')->click(); $this->find_element('className', 'dropdown-toggle')->click();
$this->assertNotNull(self::find_element('className', 'dropdown')->getText()); $this->assertNotNull($this->find_element('className', 'dropdown')->getText());
} }
} }