mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
Merge pull request #6024 from rxu/ticket/16549-master
[master][ticket/16549] Use PHPUnit 9.3+ for PHP 8.0+ tests
This commit is contained in:
commit
8d73faa594
122 changed files with 1023 additions and 614 deletions
|
@ -1010,7 +1010,7 @@ function make_clickable($text, $server_url = false, string $class = 'postlink')
|
|||
if (preg_match($magic_args[0], $text, $matches))
|
||||
{
|
||||
// Only apply $class from the corresponding function call argument (excepting emails which never has a class)
|
||||
if ($magic_args[3] != $static_class && $magic_args[1] != MAGIC_URL_EMAIL)
|
||||
if ($magic_args[1] != MAGIC_URL_EMAIL && $magic_args[3] != $static_class)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -21,23 +21,31 @@ class phpbb_acp_board_select_auth_method_test extends phpbb_test_case
|
|||
|
||||
public static function select_auth_method_data()
|
||||
{
|
||||
return array(
|
||||
array('acp_board_valid', '<option value="acp_board_valid" selected="selected" data-toggle-setting="#auth_acp_board_valid_settings">Acp_board_valid</option>'),
|
||||
array('acp_board_invalid', '<option value="acp_board_valid" data-toggle-setting="#auth_acp_board_valid_settings">Acp_board_valid</option>'),
|
||||
);
|
||||
return [
|
||||
['acp_board_valid', '<option value="acp_board_valid" selected="selected" data-toggle-setting="#auth_acp_board_valid_settings">Acp_board_valid</option>'],
|
||||
['acp_board_invalid', '<option value="acp_board_valid" data-toggle-setting="#auth_acp_board_valid_settings">Acp_board_valid</option>'],
|
||||
];
|
||||
}
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
global $phpbb_container;
|
||||
global $phpbb_container, $config;
|
||||
$phpbb_container = new phpbb_mock_container_builder();
|
||||
$config = new \phpbb\config\config([]);
|
||||
|
||||
$phpbb_container->set('auth.provider_collection', array(
|
||||
'auth.provider.acp_board_valid' => new phpbb\auth\provider\acp\board_valid,
|
||||
'auth.provider.acp_board_invalid' => new phpbb\auth\provider\acp\board_invalid,
|
||||
));
|
||||
// Create auth provider service collection
|
||||
$auth_provider_collection = new \phpbb\auth\provider_collection($phpbb_container, $config);
|
||||
$phpbb_container->set('auth.provider_collection', $auth_provider_collection);
|
||||
|
||||
// Create auth provider services
|
||||
$phpbb_container->set('auth.provider.acp_board_valid', new phpbb\auth\provider\acp\board_valid);
|
||||
$phpbb_container->set('auth.provider.acp_board_invalid', new phpbb\auth\provider\acp\board_invalid);
|
||||
|
||||
// Add auth provider servives to the service collection
|
||||
$auth_provider_collection->add('auth.provider.acp_board_valid');
|
||||
$auth_provider_collection->add('auth.provider.acp_board_invalid');
|
||||
|
||||
$this->acp_board = new acp_board();
|
||||
}
|
||||
|
|
|
@ -144,6 +144,7 @@ class phpbb_attachment_upload_test extends \phpbb_database_test_case
|
|||
$this->phpbb_dispatcher = new phpbb_mock_event_dispatcher();
|
||||
$this->temp = new \phpbb\filesystem\temp($this->filesystem, '');
|
||||
$this->user = new \phpbb\user($this->language, '\phpbb\datetime');
|
||||
$this->user->data['user_id'] = ANONYMOUS;
|
||||
|
||||
$this->upload = new \phpbb\attachment\upload(
|
||||
$this->auth,
|
||||
|
@ -187,7 +188,14 @@ class phpbb_attachment_upload_test extends \phpbb_database_test_case
|
|||
)
|
||||
),
|
||||
array('foobar', 1, true,
|
||||
array(),
|
||||
// Instead of setting to false or empty array, set default filedata array
|
||||
// as otherwise it throws PHP undefined array key warnings
|
||||
// in different file upload related services
|
||||
array(
|
||||
'realname' => null,
|
||||
'type' => null,
|
||||
'size' => null,
|
||||
),
|
||||
array(
|
||||
'error' => array(
|
||||
'NOT_UPLOADED',
|
||||
|
@ -250,7 +258,16 @@ class phpbb_attachment_upload_test extends \phpbb_database_test_case
|
|||
$this->user
|
||||
);
|
||||
|
||||
$filedata = $this->upload->upload('foobar', 1, true);
|
||||
// Instead of setting to false or empty array, set default filedata array
|
||||
// as otherwise it throws PHP undefined array key warnings
|
||||
// in different file upload related services
|
||||
$filedata = $this->upload->upload('foobar', 1, true, '', false,
|
||||
[
|
||||
'realname' => null,
|
||||
'type' => null,
|
||||
'size' => null,
|
||||
]
|
||||
);
|
||||
|
||||
$this->assertSame(array(
|
||||
'error' => array(),
|
||||
|
|
|
@ -72,14 +72,10 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case
|
|||
->with('PHP_AUTH_USER',
|
||||
\phpbb\request\request_interface::SERVER)
|
||||
->will($this->returnValue(true));
|
||||
$this->request->expects($this->at(1))
|
||||
$this->request->expects($this->exactly(2))
|
||||
->method('server')
|
||||
->with('PHP_AUTH_USER')
|
||||
->will($this->returnValue('foobar'));
|
||||
$this->request->expects($this->at(2))
|
||||
->method('server')
|
||||
->with('PHP_AUTH_PW')
|
||||
->will($this->returnValue('example'));
|
||||
->withConsecutive(['PHP_AUTH_USER'], ['PHP_AUTH_PW'])
|
||||
->will($this->onConsecutiveCalls($this->returnValue('foobar'), $this->returnValue('example')));
|
||||
|
||||
$expected = array(
|
||||
'status' => LOGIN_SUCCESS,
|
||||
|
@ -104,14 +100,10 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case
|
|||
->with('PHP_AUTH_USER',
|
||||
\phpbb\request\request_interface::SERVER)
|
||||
->will($this->returnValue(true));
|
||||
$this->request->expects($this->at(1))
|
||||
$this->request->expects($this->exactly(2))
|
||||
->method('server')
|
||||
->with('PHP_AUTH_USER')
|
||||
->will($this->returnValue('foobar'));
|
||||
$this->request->expects($this->at(2))
|
||||
->method('server')
|
||||
->with('PHP_AUTH_PW')
|
||||
->will($this->returnValue('example'));
|
||||
->withConsecutive(['PHP_AUTH_USER'], ['PHP_AUTH_PW'])
|
||||
->will($this->onConsecutiveCalls($this->returnValue('foobar'), $this->returnValue('example')));
|
||||
|
||||
$expected = array(
|
||||
'user_id' => 1,
|
||||
|
|
|
@ -330,7 +330,9 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case
|
|||
'avatar_type' => '',
|
||||
'avatar_width' => 0,
|
||||
'avatar_height' => 0,
|
||||
), 1, array(
|
||||
),
|
||||
array(
|
||||
'id' => 1,
|
||||
'avatar' => 'foobar@example.com',
|
||||
'avatar_type' => 'avatar.driver.gravatar',
|
||||
'avatar_width' => '16',
|
||||
|
@ -343,7 +345,9 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case
|
|||
'avatar_type' => '',
|
||||
'avatar_width' => 0,
|
||||
'avatar_height' => 0,
|
||||
), 5, array(
|
||||
),
|
||||
array(
|
||||
'id' => 5,
|
||||
'avatar' => 'g5_1414350991.jpg',
|
||||
'avatar_type' => 'avatar.driver.upload',
|
||||
'avatar_width' => '80',
|
||||
|
@ -356,13 +360,13 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case
|
|||
/**
|
||||
* @dataProvider data_handle_avatar_delete
|
||||
*/
|
||||
public function test_handle_avatar_delete($expected, $id, $avatar_data, $table, $prefix)
|
||||
public function test_handle_avatar_delete($expected, $avatar_data, $table, $prefix)
|
||||
{
|
||||
$this->config['allow_avatar_gravatar'] = true;
|
||||
$this->assertNull($this->manager->handle_avatar_delete($this->db, $this->user, $avatar_data, $table, $prefix));
|
||||
|
||||
$sql = 'SELECT * FROM ' . $table . '
|
||||
WHERE ' . $prefix . 'id = ' . $id;
|
||||
WHERE ' . $prefix . 'id = ' . (int) $avatar_data['id'];
|
||||
$result = $this->db->sql_query_limit($sql, 1);
|
||||
|
||||
$row = $this->manager->clean_row($this->db->sql_fetchrow($result), substr($prefix, 0, -1));
|
||||
|
|
2
tests/cache/apcu_driver_test.php
vendored
2
tests/cache/apcu_driver_test.php
vendored
|
@ -24,7 +24,7 @@ class phpbb_cache_apcu_driver_test extends phpbb_cache_common_test_case
|
|||
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml');
|
||||
}
|
||||
|
||||
static public function setUpBeforeClass()
|
||||
static public function setUpBeforeClass(): void
|
||||
{
|
||||
if (!extension_loaded('apcu'))
|
||||
{
|
||||
|
|
2
tests/cache/cache_memory.php
vendored
2
tests/cache/cache_memory.php
vendored
|
@ -31,7 +31,7 @@ class phpbb_cache_memory extends \phpbb\cache\driver\memory
|
|||
*/
|
||||
function _read($var)
|
||||
{
|
||||
return $this->data[$var];
|
||||
return $this->data[$var] ?? false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
2
tests/cache/cache_memory_test.php
vendored
2
tests/cache/cache_memory_test.php
vendored
|
@ -123,7 +123,7 @@ class phpbb_cache_memory_test extends phpbb_database_test_case
|
|||
|
||||
foreach ($sql_queries as $query)
|
||||
{
|
||||
$this->assertNotEquals(false, $this->cache->sql_load($query[0]));
|
||||
$this->assertFalse($this->cache->sql_load($query[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
2
tests/cache/memcached_test.php
vendored
2
tests/cache/memcached_test.php
vendored
|
@ -22,7 +22,7 @@ class phpbb_cache_memcached_driver_test extends \phpbb_cache_common_test_case
|
|||
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml');
|
||||
}
|
||||
|
||||
static public function setUpBeforeClass()
|
||||
static public function setUpBeforeClass(): void
|
||||
{
|
||||
if (!extension_loaded('memcached'))
|
||||
{
|
||||
|
|
2
tests/cache/redis_driver_test.php
vendored
2
tests/cache/redis_driver_test.php
vendored
|
@ -22,7 +22,7 @@ class phpbb_cache_redis_driver_test extends \phpbb_cache_common_test_case
|
|||
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml');
|
||||
}
|
||||
|
||||
static public function setUpBeforeClass()
|
||||
static public function setUpBeforeClass(): void
|
||||
{
|
||||
if (!extension_loaded('redis'))
|
||||
{
|
||||
|
|
|
@ -159,7 +159,7 @@ class phpbb_console_command_config_test extends phpbb_test_case
|
|||
'--no-newline' => false,
|
||||
));
|
||||
|
||||
$this->assertContains('CLI_CONFIG_NOT_EXISTS', $command_tester->getDisplay());
|
||||
$this->assertStringContainsString('CLI_CONFIG_NOT_EXISTS', $command_tester->getDisplay());
|
||||
}
|
||||
|
||||
public function test_increment_dynamic()
|
||||
|
@ -175,7 +175,7 @@ class phpbb_console_command_config_test extends phpbb_test_case
|
|||
'--dynamic' => true,
|
||||
));
|
||||
|
||||
$this->assertContains('CLI_CONFIG_INCREMENT_SUCCESS', $command_tester->getDisplay());
|
||||
$this->assertStringContainsString('CLI_CONFIG_INCREMENT_SUCCESS', $command_tester->getDisplay());
|
||||
$this->assertSame(2, $this->config['test_key']);
|
||||
}
|
||||
|
||||
|
@ -192,7 +192,7 @@ class phpbb_console_command_config_test extends phpbb_test_case
|
|||
'--dynamic' => false,
|
||||
));
|
||||
|
||||
$this->assertContains('CLI_CONFIG_INCREMENT_SUCCESS', $command_tester->getDisplay());
|
||||
$this->assertStringContainsString('CLI_CONFIG_INCREMENT_SUCCESS', $command_tester->getDisplay());
|
||||
$this->assertSame(2, $this->config['test_key']);
|
||||
}
|
||||
|
||||
|
@ -208,7 +208,7 @@ class phpbb_console_command_config_test extends phpbb_test_case
|
|||
'--dynamic' => true,
|
||||
));
|
||||
|
||||
$this->assertContains('CLI_CONFIG_INCREMENT_SUCCESS', $command_tester->getDisplay());
|
||||
$this->assertStringContainsString('CLI_CONFIG_INCREMENT_SUCCESS', $command_tester->getDisplay());
|
||||
$this->assertSame(2, $this->config['test_key']);
|
||||
}
|
||||
|
||||
|
@ -223,7 +223,7 @@ class phpbb_console_command_config_test extends phpbb_test_case
|
|||
'key' => 'test_key',
|
||||
));
|
||||
|
||||
$this->assertContains('CLI_CONFIG_DELETE_SUCCESS', $command_tester->getDisplay());
|
||||
$this->assertStringContainsString('CLI_CONFIG_DELETE_SUCCESS', $command_tester->getDisplay());
|
||||
$this->assertEmpty($this->config);
|
||||
}
|
||||
|
||||
|
@ -237,7 +237,7 @@ class phpbb_console_command_config_test extends phpbb_test_case
|
|||
'key' => 'wrong_key',
|
||||
));
|
||||
|
||||
$this->assertContains('CLI_CONFIG_NOT_EXISTS', $command_tester->getDisplay());
|
||||
$this->assertStringContainsString('CLI_CONFIG_NOT_EXISTS', $command_tester->getDisplay());
|
||||
$this->assertEmpty($this->config);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,19 +41,19 @@ class phpbb_console_command_cron_list_test extends phpbb_test_case
|
|||
public function test_no_task()
|
||||
{
|
||||
$this->initiate_test(0, 0);
|
||||
$this->assertContains('CRON_NO_TASKS', $this->command_tester->getDisplay());
|
||||
$this->assertStringContainsString('CRON_NO_TASKS', $this->command_tester->getDisplay());
|
||||
}
|
||||
|
||||
public function test_only_ready()
|
||||
{
|
||||
$this->initiate_test(2, 0);
|
||||
$this->assertContains('TASKS_READY command1 command2', preg_replace('/[\s*=]+/', ' ', trim($this->command_tester->getDisplay())));
|
||||
$this->assertStringContainsString('TASKS_READY command1 command2', preg_replace('/[\s*=]+/', ' ', trim($this->command_tester->getDisplay())));
|
||||
}
|
||||
|
||||
public function test_only_not_ready()
|
||||
{
|
||||
$this->initiate_test(0, 2);
|
||||
$this->assertContains('TASKS_NOT_READY command1 command2', preg_replace('/[\s*=]+/', ' ', trim($this->command_tester->getDisplay())));
|
||||
$this->assertStringContainsString('TASKS_NOT_READY command1 command2', preg_replace('/[\s*=]+/', ' ', trim($this->command_tester->getDisplay())));
|
||||
}
|
||||
|
||||
public function test_both_ready()
|
||||
|
|
|
@ -99,23 +99,22 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case
|
|||
$command_tester = $this->get_command_tester();
|
||||
$exit_status = $command_tester->execute(array('command' => $this->command_name, '--verbose' => true));
|
||||
|
||||
$this->assertContains('RUNNING_TASK', $command_tester->getDisplay());
|
||||
$this->assertStringContainsString('RUNNING_TASK', $command_tester->getDisplay());
|
||||
$this->assertSame(true, $this->task->executed);
|
||||
$this->assertSame(0, $exit_status);
|
||||
$this->assertSame(false, $this->lock->owns_lock());
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \phpbb\exception\runtime_exception
|
||||
* @expectedExceptionMessage CRON_LOCK_ERROR
|
||||
*/
|
||||
public function test_error_lock()
|
||||
{
|
||||
$this->expectException(\phpbb\exception\runtime_exception::class);
|
||||
$this->expectExceptionMessage('CRON_LOCK_ERROR');
|
||||
|
||||
$this->lock->acquire();
|
||||
$command_tester = $this->get_command_tester();
|
||||
$exit_status = $command_tester->execute(array('command' => $this->command_name));
|
||||
|
||||
$this->assertContains('CRON_LOCK_ERROR', $command_tester->getDisplay());
|
||||
$this->assertStringContainsString('CRON_LOCK_ERROR', $command_tester->getDisplay());
|
||||
$this->assertSame(false, $this->task->executed);
|
||||
$this->assertSame(1, $exit_status);
|
||||
}
|
||||
|
@ -209,7 +208,7 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case
|
|||
$command_tester = $this->get_command_tester();
|
||||
$exit_status = $command_tester->execute(array('command' => $this->command_name, '--verbose' => true));
|
||||
|
||||
$this->assertContains('CRON_NO_TASK', $command_tester->getDisplay());
|
||||
$this->assertStringContainsString('CRON_NO_TASK', $command_tester->getDisplay());
|
||||
$this->assertSame(0, $exit_status);
|
||||
$this->assertSame(false, $this->lock->owns_lock());
|
||||
}
|
||||
|
@ -225,16 +224,15 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case
|
|||
$this->assertSame(false, $this->lock->owns_lock());
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \phpbb\exception\runtime_exception
|
||||
* @expectedExceptionMessage CRON_NO_SUCH_TASK
|
||||
*/
|
||||
public function test_arg_invalid()
|
||||
{
|
||||
$this->expectException(\phpbb\exception\runtime_exception::class);
|
||||
$this->expectExceptionMessage('CRON_NO_SUCH_TASK');
|
||||
|
||||
$command_tester = $this->get_command_tester();
|
||||
$exit_status = $command_tester->execute(array('command' => $this->command_name, 'name' => 'foo'));
|
||||
|
||||
$this->assertContains('CRON_NO_SUCH_TASK', $command_tester->getDisplay());
|
||||
$this->assertStringContainsString('CRON_NO_SUCH_TASK', $command_tester->getDisplay());
|
||||
$this->assertSame(false, $this->task->executed);
|
||||
$this->assertSame(2, $exit_status);
|
||||
$this->assertSame(false, $this->lock->owns_lock());
|
||||
|
@ -245,7 +243,7 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case
|
|||
$command_tester = $this->get_command_tester();
|
||||
$exit_status = $command_tester->execute(array('command' => $this->command_name, 'name' => 'phpbb_cron_task_simple', '--verbose' => true));
|
||||
|
||||
$this->assertContains('RUNNING_TASK', $command_tester->getDisplay());
|
||||
$this->assertStringContainsString('RUNNING_TASK', $command_tester->getDisplay());
|
||||
$this->assertSame(true, $this->task->executed);
|
||||
$this->assertSame(0, $exit_status);
|
||||
$this->assertSame(false, $this->lock->owns_lock());
|
||||
|
|
|
@ -43,7 +43,7 @@ class phpbb_console_command_check_test extends phpbb_test_case
|
|||
{
|
||||
$command_tester = $this->get_command_tester('100000');
|
||||
$status = $command_tester->execute(array('command' => $this->command_name, '--no-ansi' => true, '--verbose' => true));
|
||||
$this->assertContains($this->language->lang('UPDATE_NOT_NEEDED'), $command_tester->getDisplay());
|
||||
$this->assertStringContainsString($this->language->lang('UPDATE_NOT_NEEDED'), $command_tester->getDisplay());
|
||||
$this->assertSame($status, 0);
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ class phpbb_console_command_check_test extends phpbb_test_case
|
|||
{
|
||||
$command_tester = $this->get_command_tester('0');
|
||||
$status = $command_tester->execute(array('command' => $this->command_name, '--no-ansi' => true));
|
||||
$this->assertContains($this->language->lang('UPDATE_NEEDED'), $command_tester->getDisplay());
|
||||
$this->assertStringContainsString($this->language->lang('UPDATE_NEEDED'), $command_tester->getDisplay());
|
||||
$this->assertSame($status, 1);
|
||||
}
|
||||
|
||||
|
@ -60,21 +60,20 @@ class phpbb_console_command_check_test extends phpbb_test_case
|
|||
{
|
||||
$command_tester = $this->get_command_tester('0');
|
||||
$status = $command_tester->execute(array('command' => $this->command_name, '--no-ansi' => true, '--verbose' => true));
|
||||
$this->assertContains($this->language->lang('UPDATE_NEEDED'), $command_tester->getDisplay());
|
||||
$this->assertContains($this->language->lang('UPDATES_AVAILABLE'), $command_tester->getDisplay());
|
||||
$this->assertStringContainsString($this->language->lang('UPDATE_NEEDED'), $command_tester->getDisplay());
|
||||
$this->assertStringContainsString($this->language->lang('UPDATES_AVAILABLE'), $command_tester->getDisplay());
|
||||
$this->assertSame($status, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException phpbb\exception\runtime_exception
|
||||
*/
|
||||
public function test_error()
|
||||
{
|
||||
$this->expectException(\phpbb\exception\runtime_exception::class);
|
||||
|
||||
$command_tester = $this->get_command_tester('1');
|
||||
$this->version_helper->set_file_location('acme.corp','foo', 'bar.json');
|
||||
|
||||
$status = $command_tester->execute(array('command' => $this->command_name, '--no-ansi' => true));
|
||||
$this->assertContains('VERSIONCHECK_FAIL', $command_tester->getDisplay());
|
||||
$this->assertStringContainsString('VERSIONCHECK_FAIL', $command_tester->getDisplay());
|
||||
$this->assertSame($status, 2);
|
||||
}
|
||||
|
||||
|
|
|
@ -80,6 +80,6 @@ class phpbb_console_user_activate_test extends phpbb_console_user_base
|
|||
'--deactivate' => $deactivate,
|
||||
));
|
||||
|
||||
$this->assertContains($expected, $command_tester->getDisplay());
|
||||
$this->assertStringContainsString($expected, $command_tester->getDisplay());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ class phpbb_console_user_add_test extends phpbb_console_user_base
|
|||
));
|
||||
|
||||
$this->assertNotEquals(null, $this->get_user_id('foo'));
|
||||
$this->assertContains('CLI_USER_ADD_SUCCESS', $command_tester->getDisplay());
|
||||
$this->assertStringContainsString('CLI_USER_ADD_SUCCESS', $command_tester->getDisplay());
|
||||
}
|
||||
|
||||
public function test_add_dialog()
|
||||
|
@ -113,7 +113,7 @@ class phpbb_console_user_add_test extends phpbb_console_user_base
|
|||
));
|
||||
|
||||
$this->assertNotEquals(null, $this->get_user_id('bar'));
|
||||
$this->assertContains('CLI_USER_ADD_SUCCESS', $command_tester->getDisplay());
|
||||
$this->assertStringContainsString('CLI_USER_ADD_SUCCESS', $command_tester->getDisplay());
|
||||
|
||||
}
|
||||
|
||||
|
@ -130,8 +130,8 @@ class phpbb_console_user_add_test extends phpbb_console_user_base
|
|||
'--email' => 'foo'
|
||||
));
|
||||
|
||||
$this->assertContains('USERNAME_TAKEN', $command_tester->getDisplay());
|
||||
$this->assertContains('TOO_SHORT', $command_tester->getDisplay());
|
||||
$this->assertContains('EMAIL_INVALID', $command_tester->getDisplay());
|
||||
$this->assertStringContainsString('USERNAME_TAKEN', $command_tester->getDisplay());
|
||||
$this->assertStringContainsString('TOO_SHORT', $command_tester->getDisplay());
|
||||
$this->assertStringContainsString('EMAIL_INVALID', $command_tester->getDisplay());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,7 +62,12 @@ abstract class phpbb_console_user_base extends phpbb_database_test_case
|
|||
$this->language->expects($this->any())
|
||||
->method('lang')
|
||||
->will($this->returnArgument(0));
|
||||
$user = $this->user = $this->createMock('\phpbb\user');
|
||||
|
||||
$user = $this->user = $this->createMock('\phpbb\user', array(), array(
|
||||
$this->language,
|
||||
'\phpbb\datetime'
|
||||
));
|
||||
$user->data['user_email'] = '';
|
||||
|
||||
$this->user_loader = new \phpbb\user_loader($db, $phpbb_root_path, $phpEx, USERS_TABLE);
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ class phpbb_console_user_delete_test extends phpbb_console_user_base
|
|||
));
|
||||
|
||||
$this->assertNull($this->get_user_id('Test'));
|
||||
$this->assertContains('USER_DELETED', $command_tester->getDisplay());
|
||||
$this->assertStringContainsString('USER_DELETED', $command_tester->getDisplay());
|
||||
}
|
||||
|
||||
public function test_delete_non_user()
|
||||
|
@ -70,7 +70,7 @@ class phpbb_console_user_delete_test extends phpbb_console_user_base
|
|||
'--delete-posts' => false,
|
||||
));
|
||||
|
||||
$this->assertContains('NO_USER', $command_tester->getDisplay());
|
||||
$this->assertStringContainsString('NO_USER', $command_tester->getDisplay());
|
||||
}
|
||||
|
||||
public function test_delete_cancel()
|
||||
|
|
|
@ -311,6 +311,8 @@ class phpbb_content_visibility_delete_post_test extends phpbb_database_test_case
|
|||
$lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx);
|
||||
$lang = new \phpbb\language\language($lang_loader);
|
||||
$user = new \phpbb\user($lang, '\phpbb\datetime');
|
||||
$user->data['user_id'] = ANONYMOUS;
|
||||
|
||||
$attachment_delete = new \phpbb\attachment\delete($config, $db, new \phpbb_mock_event_dispatcher(), new \phpbb\attachment\resync($db), $storage);
|
||||
|
||||
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
|
||||
|
|
|
@ -107,7 +107,10 @@ class phpbb_controller_controller_test extends phpbb_test_case
|
|||
array(new foo\controller(), array(), array()),
|
||||
array(array(new foo\controller(), 'handle_fail'), array(), array(), '\phpbb\controller\exception', 'CONTROLLER_ARGUMENT_VALUE_MISSING'),
|
||||
array('', array(), array(), '\ReflectionException', 'Function () does not exist'),
|
||||
array(new phpbb\controller\foo, array(), array(), '\ReflectionException', 'Method __invoke does not exist'),
|
||||
// Before PHP 8: 'Method __invoke does not exist'
|
||||
// As of PHP 8: 'Method phpbb\controller\foo::__invoke() does not exist'
|
||||
array(new phpbb\controller\foo, array(), array(), '\ReflectionException',
|
||||
'Method ' . (version_compare(PHP_VERSION, '8', '>=') ? 'phpbb\controller\foo::__invoke()' : '__invoke') . ' does not exist'),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ require_once dirname(__FILE__) . '/tasks/simple_should_not_run.php';
|
|||
class phpbb_cron_manager_test extends \phpbb_test_case
|
||||
{
|
||||
protected $manager;
|
||||
protected $tast_name;
|
||||
protected $task_name;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
|
|
|
@ -356,11 +356,8 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
|
|||
->will($this->returnValue(true));
|
||||
|
||||
// drop tables
|
||||
$db_tools->expects($this->exactly(2))->method('sql_table_drop');
|
||||
$db_tools->expects($this->at(1))->method('sql_table_drop')
|
||||
->with($this->equalTo('dropped_table_1'));
|
||||
$db_tools->expects($this->at(3))->method('sql_table_drop')
|
||||
->with($this->equalTo('dropped_table_2'));
|
||||
$db_tools->expects($this->exactly(2))->method('sql_table_drop')
|
||||
->withConsecutive([$this->equalTo('dropped_table_1')], [$this->equalTo('dropped_table_2')]);
|
||||
|
||||
$db_tools->perform_schema_changes(array(
|
||||
'drop_tables' => array(
|
||||
|
@ -384,11 +381,11 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
|
|||
->will($this->returnValue(true));
|
||||
|
||||
// drop columns
|
||||
$db_tools->expects($this->exactly(2))->method('sql_column_remove');
|
||||
$db_tools->expects($this->at(1))->method('sql_column_remove')
|
||||
->with($this->equalTo('existing_table'), $this->equalTo('dropped_column_1'));
|
||||
$db_tools->expects($this->at(3))->method('sql_column_remove')
|
||||
->with($this->equalTo('existing_table'), $this->equalTo('dropped_column_2'));
|
||||
$db_tools->expects($this->exactly(2))->method('sql_column_remove')
|
||||
->withConsecutive(
|
||||
[$this->equalTo('existing_table'), $this->equalTo('dropped_column_1')],
|
||||
[$this->equalTo('existing_table'), $this->equalTo('dropped_column_2')]
|
||||
);
|
||||
|
||||
$db_tools->perform_schema_changes(array(
|
||||
'drop_columns' => array(
|
||||
|
@ -425,7 +422,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
|
|||
public function test_create_int_default_null()
|
||||
{
|
||||
$this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'c_bug_13282'));
|
||||
$this->assertTrue($this->tools->sql_column_add('prefix_table_name', 'c_bug_13282', array('TINT:2')));
|
||||
$this->assertTrue($this->tools->sql_column_add('prefix_table_name', 'c_bug_13282', array('TINT:2', null)));
|
||||
$this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_bug_13282'));
|
||||
}
|
||||
|
||||
|
|
|
@ -52,6 +52,7 @@ class phpbb_email_parsing_test extends phpbb_test_case
|
|||
$lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx);
|
||||
$lang = new \phpbb\language\language($lang_loader);
|
||||
$user = new \phpbb\user($lang, '\phpbb\datetime');
|
||||
$user->data['user_lang'] = 'en';
|
||||
$phpbb_container->set('user', $user);
|
||||
$extension_manager = new phpbb_mock_extension_manager(
|
||||
dirname(__FILE__) . '/',
|
||||
|
@ -137,13 +138,13 @@ class phpbb_email_parsing_test extends phpbb_test_case
|
|||
$reflection_template = $this->reflection_template_property->getValue($this->messenger);
|
||||
$msg = trim($reflection_template->assign_display('body'));
|
||||
|
||||
$this->assertContains($author_name, $msg);
|
||||
$this->assertContains($forum_name, $msg);
|
||||
$this->assertContains($topic_title, $msg);
|
||||
$this->assertContains($username, $msg);
|
||||
$this->assertContains(htmlspecialchars_decode($config['sitename']), $msg);
|
||||
$this->assertContains(str_replace('<br />', "\n", "-- \n" . htmlspecialchars_decode($config['board_email_sig'])), $msg);
|
||||
$this->assertNotContains('EMAIL_SIG', $msg);
|
||||
$this->assertNotContains('U_STOP_WATCHING_FORUM', $msg);
|
||||
$this->assertStringContainsString($author_name, $msg);
|
||||
$this->assertStringContainsString($forum_name, $msg);
|
||||
$this->assertStringContainsString($topic_title, $msg);
|
||||
$this->assertStringContainsString($username, $msg);
|
||||
$this->assertStringContainsString(htmlspecialchars_decode($config['sitename']), $msg);
|
||||
$this->assertStringContainsString(str_replace('<br />', "\n", "-- \n" . htmlspecialchars_decode($config['board_email_sig'])), $msg);
|
||||
$this->assertStringNotContainsString('EMAIL_SIG', $msg);
|
||||
$this->assertStringNotContainsString('U_STOP_WATCHING_FORUM', $msg);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,8 @@ class phpbb_error_collector_test extends phpbb_test_case
|
|||
$collector->install();
|
||||
|
||||
// Cause a warning
|
||||
1/0; $line = __LINE__;
|
||||
// Division by zero was promoted to fatal error and throws DivisionByZeroError exception in PHP 8+
|
||||
version_compare(PHP_VERSION, '8', '>=') ? '1b'['0xFF'] : 1/0; $line = __LINE__;
|
||||
|
||||
$collector->uninstall();
|
||||
|
||||
|
@ -39,7 +40,7 @@ class phpbb_error_collector_test extends phpbb_test_case
|
|||
|
||||
// Unfortunately $error_contents will contain the full path here,
|
||||
// because the tests directory is outside of phpbb root path.
|
||||
$this->assertStringStartsWith('Errno 2: Division by zero at ', $error_contents);
|
||||
$this->assertStringStartsWith(version_compare(PHP_VERSION, '8', '>=') ? 'Errno 2: Illegal string offset "0xFF" at ' : 'Errno 2: Division by zero at ', $error_contents);
|
||||
$this->assertStringEndsWith(" line $line", $error_contents);
|
||||
}
|
||||
|
||||
|
@ -49,16 +50,19 @@ class phpbb_error_collector_test extends phpbb_test_case
|
|||
$collector->install();
|
||||
|
||||
// Cause a warning
|
||||
1/0; $line = __LINE__;
|
||||
// Division by zero was promoted to fatal error and throws DivisionByZeroError exception in PHP 8+
|
||||
version_compare(PHP_VERSION, '8', '>=') ? '1b'['0xFF'] : 1/0; $line = __LINE__;
|
||||
|
||||
// Cause a notice
|
||||
$array = array(0 => 'value');
|
||||
$value = $array[1]; $line2 = __LINE__;
|
||||
// Cause a "Notice: unserialize(): Error at offset 0 of 27 bytes in ..."
|
||||
// "Undefined array index" used earlier was promoted to warning in PHP 8.0,
|
||||
// see https://github.com/php/php-src/commit/c48b745f0090c944e77c1fbcfb6c4df3b54356ad
|
||||
unserialize("obvious non-serialized data"); $line2 = __LINE__;
|
||||
|
||||
$collector->uninstall();
|
||||
|
||||
// The notice should not be collected
|
||||
$this->assertEmpty($collector->errors[1]);
|
||||
$this->assertFalse(isset($collector->errors[1]));
|
||||
$this->assertEquals(count($collector->errors), 1);
|
||||
|
||||
list($errno, $msg_text, $errfile, $errline) = $collector->errors[0];
|
||||
$error_contents = $collector->format_errors();
|
||||
|
@ -67,7 +71,7 @@ class phpbb_error_collector_test extends phpbb_test_case
|
|||
|
||||
// Unfortunately $error_contents will contain the full path here,
|
||||
// because the tests directory is outside of phpbb root path.
|
||||
$this->assertStringStartsWith('Errno 2: Division by zero at ', $error_contents);
|
||||
$this->assertStringStartsWith(version_compare(PHP_VERSION, '8', '>=') ? 'Errno 2: Illegal string offset "0xFF" at ' : 'Errno 2: Division by zero at ', $error_contents);
|
||||
$this->assertStringEndsWith(" line $line", $error_contents);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ class exception_listener extends phpbb_test_case
|
|||
|
||||
if (isset($expected['content']))
|
||||
{
|
||||
$this->assertContains($expected['content'], $response->getContent());
|
||||
$this->assertStringContainsString($expected['content'], $response->getContent());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -169,10 +169,10 @@ class phpbb_event_php_exporter_test extends phpbb_test_case
|
|||
|
||||
/**
|
||||
* @dataProvider validate_since_throws_data
|
||||
* @expectedException LogicException
|
||||
*/
|
||||
public function test_validate_since_throws($since)
|
||||
{
|
||||
$this->expectException('LogicException');
|
||||
$this->exporter->validate_since($since);
|
||||
}
|
||||
|
||||
|
@ -203,7 +203,6 @@ class phpbb_event_php_exporter_test extends phpbb_test_case
|
|||
|
||||
/**
|
||||
* @dataProvider validate_event_throws_data
|
||||
* @expectedException LogicException
|
||||
*/
|
||||
public function test_validate_event_throws($event_name, $event, $exception_code)
|
||||
{
|
||||
|
@ -240,10 +239,10 @@ class phpbb_event_php_exporter_test extends phpbb_test_case
|
|||
|
||||
/**
|
||||
* @dataProvider validate_vars_docblock_array_throws_data
|
||||
* @expectedException LogicException
|
||||
*/
|
||||
public function test_validate_vars_docblock_array_throws($vars_array, $vars_docblock)
|
||||
{
|
||||
$this->expectException('LogicException');
|
||||
$this->exporter->validate_vars_docblock_array($vars_array, $vars_docblock);
|
||||
}
|
||||
|
||||
|
@ -282,10 +281,10 @@ class phpbb_event_php_exporter_test extends phpbb_test_case
|
|||
|
||||
/**
|
||||
* @dataProvider get_dispatch_name_throws_data
|
||||
* @expectedException LogicException
|
||||
*/
|
||||
public function test_get_dispatch_name_throws($event_line)
|
||||
{
|
||||
$this->expectException('LogicException');
|
||||
$this->exporter->set_content(array($event_line));
|
||||
$this->exporter->get_event_name(0, true);
|
||||
}
|
||||
|
@ -328,10 +327,10 @@ class phpbb_event_php_exporter_test extends phpbb_test_case
|
|||
|
||||
/**
|
||||
* @dataProvider get_trigger_event_name_throws_data
|
||||
* @expectedException LogicException
|
||||
*/
|
||||
public function test_get_trigger_event_name_throws($event_line)
|
||||
{
|
||||
$this->expectException('LogicException');
|
||||
$this->exporter->set_content(array($event_line));
|
||||
$this->exporter->get_event_name(0, false);
|
||||
}
|
||||
|
@ -459,7 +458,6 @@ class phpbb_event_php_exporter_test extends phpbb_test_case
|
|||
|
||||
/**
|
||||
* @dataProvider get_vars_from_array_throws_data
|
||||
* @expectedException LogicException
|
||||
*/
|
||||
public function test_get_vars_from_array_throws($lines, $event_line, $exception_code)
|
||||
{
|
||||
|
@ -545,7 +543,6 @@ class phpbb_event_php_exporter_test extends phpbb_test_case
|
|||
|
||||
/**
|
||||
* @dataProvider get_vars_from_docblock_throws_data
|
||||
* @expectedException LogicException
|
||||
*/
|
||||
public function test_get_vars_from_docblock_throws($lines, $event_line, $exception_code)
|
||||
{
|
||||
|
@ -649,7 +646,6 @@ class phpbb_event_php_exporter_test extends phpbb_test_case
|
|||
|
||||
/**
|
||||
* @dataProvider find_since_throws_data
|
||||
* @expectedException LogicException
|
||||
*/
|
||||
public function test_find_since_throws($lines, $event_line, $exception_code)
|
||||
{
|
||||
|
@ -751,7 +747,6 @@ class phpbb_event_php_exporter_test extends phpbb_test_case
|
|||
|
||||
/**
|
||||
* @dataProvider find_description_throws_data
|
||||
* @expectedException LogicException
|
||||
*/
|
||||
public function test_find_description_throws($lines, $event_line, $exception_code)
|
||||
{
|
||||
|
|
|
@ -21,7 +21,7 @@ class phpbb_extension_extension_base_test extends phpbb_test_case
|
|||
/** @var phpbb_mock_extension_manager */
|
||||
protected $extension_manager;
|
||||
|
||||
public static function setUpBeforeClass()
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
parent::setUpBeforeClass();
|
||||
|
||||
|
|
|
@ -102,6 +102,7 @@ class phpbb_files_types_local_test extends phpbb_test_case
|
|||
array(
|
||||
'foo',
|
||||
array(
|
||||
'realname' => null,
|
||||
'tmp_name' => 'foo',
|
||||
'size' => 500,
|
||||
'type' => 'image/png',
|
||||
|
@ -110,13 +111,17 @@ class phpbb_files_types_local_test extends phpbb_test_case
|
|||
),
|
||||
array(
|
||||
'none',
|
||||
false,
|
||||
array(
|
||||
'realname' => null,
|
||||
'size' => null,
|
||||
'type' => null,
|
||||
),
|
||||
array('PHP_SIZE_OVERRUN'),
|
||||
),
|
||||
array(
|
||||
'tests/upload/fixture/png',
|
||||
array(
|
||||
'realname' => 'foo.png',
|
||||
'realname' => 'foo.png',
|
||||
'size' => 500,
|
||||
'type' => 'image/png',
|
||||
'local_mode' => true,
|
||||
|
@ -151,7 +156,6 @@ class phpbb_files_types_local_test extends phpbb_test_case
|
|||
$upload->set_allowed_extensions(array('png'));
|
||||
$type_local->set_upload($upload);
|
||||
|
||||
|
||||
$file = $type_local->upload($filename, $upload_ary);
|
||||
$this->assertSame($expected, $file->error);
|
||||
$this->assertInstanceOf('\phpbb\files\filespec', $file);
|
||||
|
|
|
@ -17,7 +17,7 @@ class phpbb_filesystem_helper_realpath_test extends phpbb_test_case
|
|||
{
|
||||
protected static $filesystem_helper_phpbb_own_realpath;
|
||||
|
||||
static public function setUpBeforeClass()
|
||||
static public function setUpBeforeClass(): void
|
||||
{
|
||||
parent::setUpBeforeClass();
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ class phpbb_filesystem_realpath_test extends phpbb_test_case
|
|||
/** @var \phpbb\filesystem\filesystem_interface */
|
||||
protected $filesystem;
|
||||
|
||||
static public function setUpBeforeClass()
|
||||
static public function setUpBeforeClass(): void
|
||||
{
|
||||
parent::setUpBeforeClass();
|
||||
|
||||
|
|
|
@ -38,10 +38,10 @@ class phpbb_functional_acp_bbcodes_test extends phpbb_functional_test_case
|
|||
$crawler = self::submit($form);
|
||||
|
||||
$html = $crawler->filter('#preview')->html();
|
||||
$this->assertContains('<div>a</div>', $html);
|
||||
$this->assertContains('<div>b</div>', $html);
|
||||
$this->assertContains('<div>c</div>', $html);
|
||||
$this->assertContains('<div>d</div>', $html);
|
||||
$this->assertStringContainsString('<div>a</div>', $html);
|
||||
$this->assertStringContainsString('<div>b</div>', $html);
|
||||
$this->assertStringContainsString('<div>c</div>', $html);
|
||||
$this->assertStringContainsString('<div>d</div>', $html);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -105,7 +105,7 @@ class phpbb_functional_acp_groups_test extends phpbb_functional_common_groups_te
|
|||
}
|
||||
}
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContains($this->lang('GROUP_UPDATED'), $crawler->text());
|
||||
$this->assertStringContainsString($this->lang('GROUP_UPDATED'), $crawler->text());
|
||||
|
||||
$form = $this->get_group_manage_form($group_id);
|
||||
if (!isset($tick_legend) && !isset($tick_teampage))
|
||||
|
@ -117,8 +117,10 @@ class phpbb_functional_acp_groups_test extends phpbb_functional_common_groups_te
|
|||
else
|
||||
{
|
||||
$this->form_data = $form->getValues();
|
||||
$this->assertEquals($tick_legend, $this->form_data['group_legend']);
|
||||
$this->assertEquals($tick_teampage, $this->form_data['group_teampage']);
|
||||
// form_data[] values can be bool or null if not ticked, $tick_* value can be bool or null if not set.
|
||||
// Cast both to the same type to correctly compare the values.
|
||||
$this->assertEquals((bool) $tick_legend, (bool) ($this->form_data['group_legend'] ?? false));
|
||||
$this->assertEquals((bool) $tick_teampage, (bool) ($this->form_data['group_teampage'] ?? false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,21 +31,21 @@ class phpbb_functional_acp_permissions_test extends phpbb_functional_test_case
|
|||
// XXX hardcoded id
|
||||
$crawler = self::request('GET', 'adm/index.php?i=16&sid=' . $this->sid);
|
||||
// these language strings are html
|
||||
$this->assertContains($this->lang('ACP_PERMISSIONS_EXPLAIN'), $this->get_content());
|
||||
$this->assertStringContainsString($this->lang('ACP_PERMISSIONS_EXPLAIN'), $this->get_content());
|
||||
}
|
||||
|
||||
public function test_select_user()
|
||||
{
|
||||
// User permissions
|
||||
$crawler = self::request('GET', 'adm/index.php?i=acp_permissions&icat=16&mode=setting_user_global&sid=' . $this->sid);
|
||||
$this->assertContains($this->lang('ACP_USERS_PERMISSIONS_EXPLAIN'), $this->get_content());
|
||||
$this->assertStringContainsString($this->lang('ACP_USERS_PERMISSIONS_EXPLAIN'), $this->get_content());
|
||||
|
||||
// Select admin
|
||||
$form = $crawler->selectButton($this->lang('SUBMIT'))->form();
|
||||
$data = array('username[0]' => 'admin');
|
||||
$form->setValues($data);
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContains($this->lang('ACL_SET'), $crawler->filter('h1')->eq(1)->text());
|
||||
$this->assertStringContainsString($this->lang('ACL_SET'), $crawler->filter('h1')->eq(1)->text());
|
||||
}
|
||||
|
||||
public function permissions_data()
|
||||
|
@ -93,7 +93,7 @@ class phpbb_functional_acp_permissions_test extends phpbb_functional_test_case
|
|||
{
|
||||
// Get the form
|
||||
$crawler = self::request('GET', "adm/index.php?i=acp_permissions&icat=16&mode=$mode&${object_name}[0]=$object_id&type=$permission_type&sid=" . $this->sid);
|
||||
$this->assertContains($this->lang('ACL_SET'), $crawler->filter('h1')->eq(1)->text());
|
||||
$this->assertStringContainsString($this->lang('ACL_SET'), $crawler->filter('h1')->eq(1)->text());
|
||||
|
||||
// XXX globals for \phpbb\auth\auth, refactor it later
|
||||
global $db, $cache;
|
||||
|
@ -115,7 +115,7 @@ class phpbb_functional_acp_permissions_test extends phpbb_functional_test_case
|
|||
$data = array("setting[$object_id][0][$permission]" => '0');
|
||||
$form->setValues($data);
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContains($this->lang('AUTH_UPDATED'), $crawler->text());
|
||||
$this->assertStringContainsString($this->lang('AUTH_UPDATED'), $crawler->text());
|
||||
|
||||
// check acl again
|
||||
$auth = new \phpbb\auth\auth;
|
||||
|
|
|
@ -34,7 +34,7 @@ class phpbb_functional_acp_users_test extends phpbb_functional_test_case
|
|||
$crawler = self::request('GET', "adm/index.php?i=users&mode=overview&u=$user_id&sid={$this->sid}");
|
||||
$form = $crawler->filter('#user_delete')->selectButton($this->lang('SUBMIT'))->form();
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContains($this->lang('CANNOT_REMOVE_FOUNDER'), $this->get_content());
|
||||
$this->assertStringContainsString($this->lang('CANNOT_REMOVE_FOUNDER'), $this->get_content());
|
||||
}
|
||||
|
||||
protected function make_founder($user_id)
|
||||
|
@ -44,6 +44,6 @@ class phpbb_functional_acp_users_test extends phpbb_functional_test_case
|
|||
$data = array('user_founder' => '1');
|
||||
$form->setValues($data);
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContains($this->lang('USER_OVERVIEW_UPDATED'), $this->get_content());
|
||||
$this->assertStringContainsString($this->lang('USER_OVERVIEW_UPDATED'), $this->get_content());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case
|
|||
|
||||
// check for logout link
|
||||
$crawler = self::request('GET', 'index.php');
|
||||
$this->assertContains($this->lang('LOGOUT', 'admin'), $crawler->filter('.navbar')->text());
|
||||
$this->assertStringContainsString($this->lang('LOGOUT', 'admin'), $crawler->filter('.navbar')->text());
|
||||
}
|
||||
|
||||
public function test_login_other()
|
||||
|
@ -30,7 +30,7 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case
|
|||
$this->create_user('anothertestuser');
|
||||
$this->login('anothertestuser');
|
||||
$crawler = self::request('GET', 'index.php');
|
||||
$this->assertContains('anothertestuser', $crawler->filter('#username_logged_in')->text());
|
||||
$this->assertStringContainsString('anothertestuser', $crawler->filter('#username_logged_in')->text());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -46,7 +46,7 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case
|
|||
$config['auth_method'] = 'foobar';
|
||||
$this->login('anothertestuser');
|
||||
$crawler = self::request('GET', 'index.php');
|
||||
$this->assertContains('anothertestuser', $crawler->filter('#username_logged_in')->text());
|
||||
$this->assertStringContainsString('anothertestuser', $crawler->filter('#username_logged_in')->text());
|
||||
$sql = 'UPDATE ' . CONFIG_TABLE . " SET config_value = 'db' WHERE config_name = 'auth_method'";
|
||||
$db->sql_query($sql);
|
||||
$config['auth_method'] = 'db';
|
||||
|
@ -65,7 +65,7 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case
|
|||
|
||||
// look for a register link, which should be visible only when logged out
|
||||
$crawler = self::request('GET', 'index.php');
|
||||
$this->assertContains($this->lang('REGISTER'), $crawler->filter('.navbar')->text());
|
||||
$this->assertStringContainsString($this->lang('REGISTER'), $crawler->filter('.navbar')->text());
|
||||
}
|
||||
|
||||
public function test_acp_login()
|
||||
|
@ -75,6 +75,6 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case
|
|||
|
||||
// check that we are logged in
|
||||
$crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid);
|
||||
$this->assertContains($this->lang('ADMIN_PANEL'), $crawler->filter('h1')->text());
|
||||
$this->assertStringContainsString($this->lang('ADMIN_PANEL'), $crawler->filter('h1')->text());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,6 +80,6 @@ class phpbb_functional_avatar_acp_groups_test extends phpbb_functional_common_av
|
|||
$crawler = self::request('GET', $this->get_url() . '&sid=' . $this->sid);
|
||||
$form = $crawler->selectButton($this->lang('SUBMIT'))->form();
|
||||
$form_data = $form->getValues();
|
||||
$this->assertEmpty($form_data['avatar_type']);
|
||||
$this->assertFalse(isset($form_data['avatar_type']));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ abstract class phpbb_functional_common_avatar_test_case extends phpbb_functional
|
|||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
$this->assertContains($expected, $crawler->text());
|
||||
$this->assertStringContainsString($expected, $crawler->text());
|
||||
}
|
||||
|
||||
if ($delete)
|
||||
|
|
|
@ -47,9 +47,9 @@ abstract class phpbb_functional_common_groups_test_case extends phpbb_functional
|
|||
|
||||
$crawler = self::request('GET', 'adm/index.php?i=board&mode=avatar&sid=' . $this->sid);
|
||||
// Check the default entries we should have
|
||||
$this->assertContains($this->lang('ALLOW_REMOTE_UPLOAD'), $crawler->text());
|
||||
$this->assertContains($this->lang('ALLOW_AVATARS'), $crawler->text());
|
||||
$this->assertContains($this->lang('ALLOW_LOCAL'), $crawler->text());
|
||||
$this->assertStringContainsString($this->lang('ALLOW_REMOTE_UPLOAD'), $crawler->text());
|
||||
$this->assertStringContainsString($this->lang('ALLOW_AVATARS'), $crawler->text());
|
||||
$this->assertStringContainsString($this->lang('ALLOW_LOCAL'), $crawler->text());
|
||||
|
||||
// Now start setting the needed settings
|
||||
$form = $crawler->selectButton($this->lang('SUBMIT'))->form();
|
||||
|
@ -57,7 +57,7 @@ abstract class phpbb_functional_common_groups_test_case extends phpbb_functional
|
|||
$form['config[allow_avatar_remote]']->select(1);
|
||||
$form['config[allow_avatar_remote_upload]']->select(1);
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContains($this->lang('CONFIG_UPDATED'), $crawler->text());
|
||||
$this->assertStringContainsString($this->lang('CONFIG_UPDATED'), $crawler->text());
|
||||
}
|
||||
|
||||
public function groups_manage_test_data()
|
||||
|
@ -82,7 +82,7 @@ abstract class phpbb_functional_common_groups_test_case extends phpbb_functional
|
|||
$form = $this->get_group_manage_form();
|
||||
$form['group_colour']->setValue($input);
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContains($this->lang($expected), $crawler->text());
|
||||
$this->assertStringContainsString($this->lang($expected), $crawler->text());
|
||||
}
|
||||
|
||||
public function group_avatar_min_max_data()
|
||||
|
@ -112,6 +112,6 @@ abstract class phpbb_functional_common_groups_test_case extends phpbb_functional
|
|||
$form['avatar_driver']->setValue($avatar_type);
|
||||
$form[$form_name]->setValue($input);
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContains($this->lang($expected), $crawler->text());
|
||||
$this->assertStringContainsString($this->lang($expected), $crawler->text());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ class phpbb_functional_download_test extends phpbb_functional_test_case
|
|||
$post = $this->create_topic($this->data['forums']['Download #1'], 'Download Topic #1', 'This is a test topic posted by the testing framework.', array('upload_files' => 1));
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
|
||||
|
||||
$this->assertContains('Download Topic #1', $crawler->filter('html')->text());
|
||||
$this->assertStringContainsString('Download Topic #1', $crawler->filter('html')->text());
|
||||
$this->data['topics']['Download Topic #1'] = (int) $post['topic_id'];
|
||||
$this->data['posts']['Download Topic #1'] = (int) $this->get_parameter_from_link($crawler->filter('.post')->selectLink($this->lang('POST', '', ''))->link()->getUri(), 'p');
|
||||
|
||||
|
@ -57,7 +57,7 @@ class phpbb_functional_download_test extends phpbb_functional_test_case
|
|||
$post2 = $this->create_post($this->data['forums']['Download #1'], $post['topic_id'], 'Re: Download Topic #1-#2', 'This is a test post posted by the testing framework.', array('upload_files' => 1));
|
||||
$crawler = self::request('GET', "viewtopic.php?p={$post2['post_id']}&sid={$this->sid}");
|
||||
|
||||
$this->assertContains('Re: Download Topic #1-#2', $crawler->filter('html')->text());
|
||||
$this->assertStringContainsString('Re: Download Topic #1-#2', $crawler->filter('html')->text());
|
||||
$this->data['posts']['Re: Download Topic #1-#2'] = (int) $post2['post_id'];
|
||||
}
|
||||
|
||||
|
@ -115,7 +115,7 @@ class phpbb_functional_download_test extends phpbb_functional_test_case
|
|||
$this->assertContainsLang('POST_DELETED', $crawler->text());
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Download Topic #1']}&sid={$this->sid}");
|
||||
$this->assertContains($this->lang('POST_DISPLAY', '', ''), $crawler->text());
|
||||
$this->assertStringContainsString($this->lang('POST_DISPLAY', '', ''), $crawler->text());
|
||||
}
|
||||
|
||||
public function test_download_softdeleted_post()
|
||||
|
@ -182,7 +182,7 @@ class phpbb_functional_download_test extends phpbb_functional_test_case
|
|||
$this->assertContainsLang('TOPIC_DELETED_SUCCESS', $crawler->text());
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Download Topic #1']}&sid={$this->sid}");
|
||||
$this->assertContains('Download Topic #1', $crawler->filter('h2')->text());
|
||||
$this->assertStringContainsString('Download Topic #1', $crawler->filter('h2')->text());
|
||||
}
|
||||
|
||||
public function test_download_softdeleted_topic()
|
||||
|
|
|
@ -22,7 +22,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case
|
|||
'./',
|
||||
);
|
||||
|
||||
static public function setUpBeforeClass()
|
||||
static public function setUpBeforeClass(): void
|
||||
{
|
||||
parent::setUpBeforeClass();
|
||||
|
||||
|
@ -30,7 +30,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case
|
|||
self::$helper->copy_ext_fixtures(dirname(__FILE__) . '/../extension/ext/', self::$fixtures);
|
||||
}
|
||||
|
||||
static public function tearDownAfterClass()
|
||||
static public function tearDownAfterClass(): void
|
||||
{
|
||||
parent::tearDownAfterClass();
|
||||
|
||||
|
@ -88,27 +88,27 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case
|
|||
$this->assertCount(1, $crawler->filter('.ext_enabled'));
|
||||
$this->assertCount(7, $crawler->filter('.ext_disabled'));
|
||||
|
||||
$this->assertContains('phpBB Foo Extension', $crawler->filter('.ext_enabled')->eq(0)->text());
|
||||
$this->assertStringContainsString('phpBB Foo Extension', $crawler->filter('.ext_enabled')->eq(0)->text());
|
||||
$this->assertContainsLang('EXTENSION_DISABLE', $crawler->filter('.ext_enabled')->eq(0)->text());
|
||||
|
||||
$this->assertContains('phpBB Moo Extension', $crawler->filter('.ext_disabled')->eq(2)->text());
|
||||
$this->assertStringContainsString('phpBB Moo Extension', $crawler->filter('.ext_disabled')->eq(2)->text());
|
||||
$this->assertContainsLang('DETAILS', $crawler->filter('.ext_disabled')->eq(2)->text());
|
||||
$this->assertContainsLang('EXTENSION_ENABLE', $crawler->filter('.ext_disabled')->eq(2)->text());
|
||||
$this->assertContainsLang('EXTENSION_DELETE_DATA', $crawler->filter('.ext_disabled')->eq(2)->text());
|
||||
|
||||
$this->assertContains('The “vendor/test2” extension is not valid.', $crawler->filter('.ext_disabled')->eq(0)->text());
|
||||
$this->assertStringContainsString('The “vendor/test2” extension is not valid.', $crawler->filter('.ext_disabled')->eq(0)->text());
|
||||
|
||||
$this->assertContains('The “vendor/test3” extension is not valid.', $crawler->filter('.ext_disabled')->eq(1)->text());
|
||||
$this->assertStringContainsString('The “vendor/test3” extension is not valid.', $crawler->filter('.ext_disabled')->eq(1)->text());
|
||||
|
||||
$this->assertContains('phpBB Bar Extension', $crawler->filter('.ext_disabled')->eq(3)->text());
|
||||
$this->assertStringContainsString('phpBB Bar Extension', $crawler->filter('.ext_disabled')->eq(3)->text());
|
||||
$this->assertContainsLang('DETAILS', $crawler->filter('.ext_disabled')->eq(3)->text());
|
||||
$this->assertContainsLang('EXTENSION_ENABLE', $crawler->filter('.ext_disabled')->eq(3)->text());
|
||||
|
||||
// Check that invalid extensions are not listed.
|
||||
$this->assertNotContains('phpBB BarFoo Extension', $crawler->filter('.table1')->text());
|
||||
$this->assertNotContains('barfoo', $crawler->filter('.table1')->text());
|
||||
$this->assertStringNotContainsString('phpBB BarFoo Extension', $crawler->filter('.table1')->text());
|
||||
$this->assertStringNotContainsString('barfoo', $crawler->filter('.table1')->text());
|
||||
|
||||
$this->assertNotContains('vendor3/bar', $crawler->filter('.table1')->text());
|
||||
$this->assertStringNotContainsString('vendor3/bar', $crawler->filter('.table1')->text());
|
||||
}
|
||||
|
||||
public function test_details()
|
||||
|
@ -143,7 +143,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case
|
|||
{
|
||||
$match = true;
|
||||
|
||||
$this->assertContains($expected, $text);
|
||||
$this->assertStringContainsString($expected, $text);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -163,7 +163,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case
|
|||
$this->assertContainsLang('EXTENSION_ACTIONS', $crawler->filter('div.main thead')->text());
|
||||
|
||||
$crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid);
|
||||
$this->assertContains($this->lang('EXTENSION_ENABLE_CONFIRM', 'phpBB Moo Extension'), $crawler->filter('#main')->text());
|
||||
$this->assertStringContainsString($this->lang('EXTENSION_ENABLE_CONFIRM', 'phpBB Moo Extension'), $crawler->filter('#main')->text());
|
||||
|
||||
// Correctly submit the enable form, default not enableable message
|
||||
$crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=vendor3%2Ffoo&sid=' . $this->sid);
|
||||
|
@ -171,8 +171,8 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case
|
|||
|
||||
// Custom reason messages returned by not enableable extension
|
||||
$crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=vendor5%2Ffoo&sid=' . $this->sid);
|
||||
$this->assertContains('Reason 1', $crawler->filter('.errorbox')->text());
|
||||
$this->assertContains('Reason 2', $crawler->filter('.errorbox')->text());
|
||||
$this->assertStringContainsString('Reason 1', $crawler->filter('.errorbox')->text());
|
||||
$this->assertStringContainsString('Reason 2', $crawler->filter('.errorbox')->text());
|
||||
}
|
||||
|
||||
public function test_disable_pre()
|
||||
|
@ -184,14 +184,14 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case
|
|||
$this->assertContainsLang('EXTENSION_ACTIONS', $crawler->filter('div.main thead')->text());
|
||||
|
||||
$crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable_pre&ext_name=vendor2%2Ffoo&sid=' . $this->sid);
|
||||
$this->assertContains($this->lang('EXTENSION_DISABLE_CONFIRM', 'phpBB Foo Extension'), $crawler->filter('#main')->text());
|
||||
$this->assertStringContainsString($this->lang('EXTENSION_DISABLE_CONFIRM', 'phpBB Foo Extension'), $crawler->filter('#main')->text());
|
||||
}
|
||||
|
||||
public function test_delete_data_pre()
|
||||
{
|
||||
// test2 is not available (error)
|
||||
$crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=test2&sid=' . $this->sid);
|
||||
$this->assertContains($this->lang('FILE_NOT_FOUND', ''), $crawler->filter('.errorbox')->text());
|
||||
$this->assertStringContainsString($this->lang('FILE_NOT_FOUND', ''), $crawler->filter('.errorbox')->text());
|
||||
|
||||
// foo is not disabled (redirect to list)
|
||||
$crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=vendor2%2Ffoo&sid=' . $this->sid);
|
||||
|
@ -200,7 +200,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case
|
|||
$this->assertContainsLang('EXTENSION_ACTIONS', $crawler->filter('div.main thead')->text());
|
||||
|
||||
$crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid);
|
||||
$this->assertContains('Are you sure that you wish to delete the data associated with “phpBB Moo Extension”?', $crawler->filter('.errorbox')->text());
|
||||
$this->assertStringContainsString('Are you sure that you wish to delete the data associated with “phpBB Moo Extension”?', $crawler->filter('.errorbox')->text());
|
||||
}
|
||||
|
||||
public function test_actions()
|
||||
|
|
|
@ -30,7 +30,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
|
|||
'foo/foo/controller/',
|
||||
);
|
||||
|
||||
static public function setUpBeforeClass()
|
||||
static public function setUpBeforeClass(): void
|
||||
{
|
||||
parent::setUpBeforeClass();
|
||||
|
||||
|
@ -38,7 +38,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
|
|||
self::$helper->copy_ext_fixtures(dirname(__FILE__) . '/fixtures/ext/', self::$fixtures);
|
||||
}
|
||||
|
||||
static public function tearDownAfterClass()
|
||||
static public function tearDownAfterClass(): void
|
||||
{
|
||||
parent::tearDownAfterClass();
|
||||
|
||||
|
@ -62,7 +62,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
|
|||
$this->phpbb_extension_manager->enable('foo/bar');
|
||||
$crawler = self::request('GET', 'app.php/foo/bar', array(), false);
|
||||
self::assert_response_status_code();
|
||||
$this->assertContains("foo/bar controller handle() method", $crawler->filter('body')->text());
|
||||
$this->assertStringContainsString("foo/bar controller handle() method", $crawler->filter('body')->text());
|
||||
$this->phpbb_extension_manager->purge('foo/bar');
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
|
|||
$this->phpbb_extension_manager->enable('foo/foo');
|
||||
$crawler = self::request('GET', 'app.php/foo/foo', array(), false);
|
||||
self::assert_response_status_code();
|
||||
$this->assertContains("foo/foo controller handle() method", $crawler->filter('body')->text());
|
||||
$this->assertStringContainsString("foo/foo controller handle() method", $crawler->filter('body')->text());
|
||||
$this->phpbb_extension_manager->purge('foo/foo');
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
|
|||
{
|
||||
$this->phpbb_extension_manager->enable('foo/bar');
|
||||
$crawler = self::request('GET', 'app.php/foo/template');
|
||||
$this->assertContains("I am a variable", $crawler->filter('#content')->text());
|
||||
$this->assertStringContainsString("I am a variable", $crawler->filter('#content')->text());
|
||||
$this->phpbb_extension_manager->purge('foo/bar');
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
|
|||
public function test_controller_template_include_js_css()
|
||||
{
|
||||
$crawler = self::request('GET', 'app.php/help/faq');
|
||||
$this->assertContains("./../../assets/javascript/core.js", $crawler->filter('body')->html());
|
||||
$this->assertStringContainsString("./../../assets/javascript/core.js", $crawler->filter('body')->html());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -107,7 +107,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
|
|||
$this->phpbb_extension_manager->enable('foo/bar');
|
||||
$crawler = self::request('GET', 'app.php/foo/baz', array(), false);
|
||||
$this->assert_response_html(500);
|
||||
$this->assertContains('Missing value for argument #1: test in class foo\bar\controller\controller:baz', $crawler->filter('body')->text());
|
||||
$this->assertStringContainsString('Missing value for argument #1: test in class foo\bar\controller\controller:baz', $crawler->filter('body')->text());
|
||||
$this->phpbb_extension_manager->purge('foo/bar');
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
|
|||
$this->phpbb_extension_manager->enable('foo/bar');
|
||||
$crawler = self::request('GET', 'app.php/foo/exception', array(), false);
|
||||
$this->assert_response_html(500);
|
||||
$this->assertContains('Exception thrown from foo/exception route', $crawler->filter('body')->text());
|
||||
$this->assertStringContainsString('Exception thrown from foo/exception route', $crawler->filter('body')->text());
|
||||
$this->phpbb_extension_manager->purge('foo/bar');
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
|
|||
{
|
||||
$crawler = self::request('GET', 'app.php/does/not/exist', array(), false);
|
||||
$this->assert_response_html(404);
|
||||
$this->assertContains('No route found for "GET /does/not/exist"', $crawler->filter('body')->text());
|
||||
$this->assertStringContainsString('No route found for "GET /does/not/exist"', $crawler->filter('body')->text());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -157,7 +157,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
|
|||
$this->assertStringStartsWith('./app.php/foo/login_redirect', $form->get('redirect')->getValue());
|
||||
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContains("I am a variable", $crawler->filter('#content')->text(), 'Unsuccessful redirect after using login_box()');
|
||||
$this->assertStringContainsString("I am a variable", $crawler->filter('#content')->text(), 'Unsuccessful redirect after using login_box()');
|
||||
$this->phpbb_extension_manager->purge('foo/bar');
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ class phpbb_functional_extension_global_lang_test extends phpbb_functional_test_
|
|||
'foo/bar/language/en/',
|
||||
);
|
||||
|
||||
static public function setUpBeforeClass()
|
||||
static public function setUpBeforeClass(): void
|
||||
{
|
||||
parent::setUpBeforeClass();
|
||||
|
||||
|
@ -34,7 +34,7 @@ class phpbb_functional_extension_global_lang_test extends phpbb_functional_test_
|
|||
self::$helper->copy_ext_fixtures(dirname(__FILE__) . '/fixtures/ext/', self::$fixtures);
|
||||
}
|
||||
|
||||
static public function tearDownAfterClass()
|
||||
static public function tearDownAfterClass(): void
|
||||
{
|
||||
parent::tearDownAfterClass();
|
||||
|
||||
|
@ -67,9 +67,9 @@ class phpbb_functional_extension_global_lang_test extends phpbb_functional_test_
|
|||
$crawler = self::request('GET', 'index.php');
|
||||
|
||||
// language from language/en/common.php
|
||||
$this->assertNotContains('Skip to content', $crawler->filter('.skiplink')->text());
|
||||
$this->assertStringNotContainsString('Skip to content', $crawler->filter('.skiplink')->text());
|
||||
|
||||
// language from ext/foo/bar/language/en/foo_global.php
|
||||
$this->assertContains('Overwritten by foo', $crawler->filter('.skiplink')->text());
|
||||
$this->assertStringContainsString('Overwritten by foo', $crawler->filter('.skiplink')->text());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ class phpbb_functional_extension_module_test extends phpbb_functional_test_case
|
|||
'./',
|
||||
);
|
||||
|
||||
static public function setUpBeforeClass()
|
||||
static public function setUpBeforeClass(): void
|
||||
{
|
||||
parent::setUpBeforeClass();
|
||||
|
||||
|
@ -33,7 +33,7 @@ class phpbb_functional_extension_module_test extends phpbb_functional_test_case
|
|||
self::$helper->copy_ext_fixtures(dirname(__FILE__) . '/fixtures/ext/', self::$fixtures);
|
||||
}
|
||||
|
||||
static public function tearDownAfterClass()
|
||||
static public function tearDownAfterClass(): void
|
||||
{
|
||||
parent::tearDownAfterClass();
|
||||
|
||||
|
@ -118,7 +118,7 @@ class phpbb_functional_extension_module_test extends phpbb_functional_test_case
|
|||
$this->admin_login();
|
||||
|
||||
$crawler = self::request('GET', 'adm/index.php?i=foo%5cbar%5cacp%5cmain_module&mode=mode&sid=' . $this->sid);
|
||||
$this->assertContains('Bertie rulez!', $crawler->filter('#main')->text());
|
||||
$this->assertStringContainsString('Bertie rulez!', $crawler->filter('#main')->text());
|
||||
}
|
||||
|
||||
public function test_ucp()
|
||||
|
@ -126,11 +126,11 @@ class phpbb_functional_extension_module_test extends phpbb_functional_test_case
|
|||
$this->login();
|
||||
|
||||
$crawler = self::request('GET', 'ucp.php?sid=' . $this->sid);
|
||||
$this->assertContains('UCP_FOOBAR_TITLE', $crawler->filter('#tabs')->text());
|
||||
$this->assertStringContainsString('UCP_FOOBAR_TITLE', $crawler->filter('#tabs')->text());
|
||||
|
||||
$link = $crawler->selectLink('UCP_FOOBAR_TITLE')->link()->getUri();
|
||||
$crawler = self::request('GET', substr($link, strpos($link, 'ucp.')));
|
||||
$this->assertContains('UCP Extension Template Test Passed!', $crawler->filter('#content')->text());
|
||||
$this->assertStringContainsString('UCP Extension Template Test Passed!', $crawler->filter('#content')->text());
|
||||
|
||||
$this->phpbb_extension_manager->purge('foo/bar');
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ class phpbb_functional_extension_permission_lang_test extends phpbb_functional_t
|
|||
'foo/bar/language/en/',
|
||||
);
|
||||
|
||||
static public function setUpBeforeClass()
|
||||
static public function setUpBeforeClass(): void
|
||||
{
|
||||
parent::setUpBeforeClass();
|
||||
|
||||
|
@ -34,7 +34,7 @@ class phpbb_functional_extension_permission_lang_test extends phpbb_functional_t
|
|||
self::$helper->copy_ext_fixtures(dirname(__FILE__) . '/fixtures/ext/', self::$fixtures);
|
||||
}
|
||||
|
||||
static public function tearDownAfterClass()
|
||||
static public function tearDownAfterClass(): void
|
||||
{
|
||||
parent::tearDownAfterClass();
|
||||
|
||||
|
@ -78,9 +78,9 @@ class phpbb_functional_extension_permission_lang_test extends phpbb_functional_t
|
|||
$crawler = self::submit($form);
|
||||
|
||||
// language from language/en/acp/permissions_phpbb.php
|
||||
$this->assertContains('Can attach files', $crawler->filter('body')->text());
|
||||
$this->assertStringContainsString('Can attach files', $crawler->filter('body')->text());
|
||||
|
||||
// language from ext/foo/bar/language/en/permissions_foo.php
|
||||
$this->assertContains('Can view foobar', $crawler->filter('body')->text());
|
||||
$this->assertStringContainsString('Can view foobar', $crawler->filter('body')->text());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,9 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
|
|||
{
|
||||
parent::__construct($name, $data, $dataName);
|
||||
|
||||
$this->backupStaticAttributesBlacklist['phpbb_functional_feed_test'] = array('init_values');
|
||||
$this->excludeBackupStaticAttributes([
|
||||
'phpbb_functional_feed_test' => ['init_values'],
|
||||
]);
|
||||
|
||||
$this->purge_cache();
|
||||
}
|
||||
|
@ -74,7 +76,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
|
|||
$this->add_lang('acp/permissions');
|
||||
|
||||
$crawler = self::request('GET', "adm/index.php?i=acp_permissions&sid={$this->sid}&icat=16&mode=setting_group_global&group_id[0]=1");
|
||||
self::assertContains($this->lang('ACL_SET'), $crawler->filter('h1')->eq(1)->text());
|
||||
self::assertStringContainsString($this->lang('ACL_SET'), $crawler->filter('h1')->eq(1)->text());
|
||||
|
||||
$form = $crawler->selectButton($this->lang('APPLY_PERMISSIONS'))->form();
|
||||
$form['setting[1][0][u_download]']->select(-1);
|
||||
|
@ -338,7 +340,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
|
|||
$post = $this->create_topic($this->data['forums']['Feeds #news'], 'Feeds #news - Topic #2', 'This is a test topic posted by the testing framework.');
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
|
||||
|
||||
self::assertContains('Feeds #news - Topic #2', $crawler->filter('html')->text());
|
||||
self::assertStringContainsString('Feeds #news - Topic #2', $crawler->filter('html')->text());
|
||||
$this->data['topics']['Feeds #news - Topic #2'] = (int) $post['topic_id'];
|
||||
$this->data['posts']['Feeds #news - Topic #2'] = (int) $this->get_parameter_from_link($crawler->filter('.post')->selectLink($this->lang('POST', '', ''))->link()->getUri(), 'p');
|
||||
|
||||
|
@ -346,7 +348,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
|
|||
$post2 = $this->create_post($this->data['forums']['Feeds #news'], $post['topic_id'], 'Re: Feeds #news - Topic #2', 'This is a test post posted by the testing framework.');
|
||||
$crawler = self::request('GET', "viewtopic.php?p={$post2['post_id']}&sid={$this->sid}");
|
||||
|
||||
self::assertContains('Re: Feeds #news - Topic #2', $crawler->filter('html')->text());
|
||||
self::assertStringContainsString('Re: Feeds #news - Topic #2', $crawler->filter('html')->text());
|
||||
$this->data['posts']['Re: Feeds #news - Topic #2'] = (int) $post2['post_id'];
|
||||
}
|
||||
|
||||
|
@ -502,7 +504,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
|
|||
$post2 = $this->create_post($this->data['forums']['Feeds #1'], $post['topic_id'], 'Re: Feeds #1 - Topic #2', 'This is a test post posted by the testing framework.');
|
||||
$crawler = self::request('GET', "viewtopic.php?p={$post2['post_id']}&sid={$this->sid}");
|
||||
|
||||
self::assertContains('Re: Feeds #1 - Topic #2', $crawler->filter('html')->text());
|
||||
self::assertStringContainsString('Re: Feeds #1 - Topic #2', $crawler->filter('html')->text());
|
||||
$this->data['posts']['Re: Feeds #1 - Topic #2'] = (int) $post2['post_id'];
|
||||
}
|
||||
|
||||
|
@ -530,7 +532,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
|
|||
self::assertContainsLang('POST_DELETED', $crawler->text());
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Feeds #1 - Topic #2']}&sid={$this->sid}");
|
||||
self::assertContains($this->lang('POST_DISPLAY', '', ''), $crawler->text());
|
||||
self::assertStringContainsString($this->lang('POST_DISPLAY', '', ''), $crawler->text());
|
||||
}
|
||||
|
||||
public function test_feeds_softdeleted_post_admin()
|
||||
|
@ -630,7 +632,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
|
|||
self::assertContainsLang('TOPIC_DELETED_SUCCESS', $crawler->text());
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Feeds #1 - Topic #2']}&sid={$this->sid}");
|
||||
self::assertContains('Feeds #1 - Topic #2', $crawler->filter('h2')->text());
|
||||
self::assertStringContainsString('Feeds #1 - Topic #2', $crawler->filter('h2')->text());
|
||||
}
|
||||
|
||||
public function test_feeds_softdeleted_topic_admin()
|
||||
|
@ -769,7 +771,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
|
|||
$this->create_post($this->data['forums']['Feeds #1.1'], $post['topic_id'], 'Re: Feeds #1.1 - Topic #2', 'This is a test post posted by the testing framework.', array(), 'POST_STORED_MOD');
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Feeds #1.1 - Topic #2']}&sid={$this->sid}");
|
||||
self::assertNotContains('Re: Feeds #1.1 - Topic #2', $crawler->filter('html')->text());
|
||||
self::assertStringNotContainsString('Re: Feeds #1.1 - Topic #2', $crawler->filter('html')->text());
|
||||
}
|
||||
|
||||
public function test_feeds_unapproved_post_admin()
|
||||
|
@ -860,7 +862,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
|
|||
$this->create_topic($this->data['forums']['Feeds #1.1'], 'Feeds #1.1 - Topic #3', 'This is a test topic posted by the testing framework.', array(), 'POST_STORED_MOD');
|
||||
|
||||
$crawler = self::request('GET', "viewforum.php?f={$this->data['forums']['Feeds #1.1']}&sid={$this->sid}");
|
||||
self::assertNotContains('Feeds #1.1 - Topic #3', $crawler->filter('html')->text());
|
||||
self::assertStringNotContainsString('Feeds #1.1 - Topic #3', $crawler->filter('html')->text());
|
||||
|
||||
$this->logout();
|
||||
$this->set_flood_interval(15);
|
||||
|
@ -1012,7 +1014,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
|
|||
$post = $this->create_topic($this->data['forums']['Feeds #1'], 'Feeds #1 - Topic #3', 'This is a test topic posted by the testing framework. [attachment=0]Attachment #0[/attachment]', array('upload_files' => 1));
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
|
||||
|
||||
self::assertContains('Feeds #1 - Topic #3', $crawler->filter('html')->text());
|
||||
self::assertStringContainsString('Feeds #1 - Topic #3', $crawler->filter('html')->text());
|
||||
$this->data['topics']['Feeds #1 - Topic #3'] = (int) $post['topic_id'];
|
||||
}
|
||||
|
||||
|
@ -1230,7 +1232,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
|
|||
$post2 = $this->create_post($this->data['forums']['Feeds #1'], $this->data['topics']['Feeds #1 - Topic #3'], 'Re: Feeds #1 - Topic #3-1', 'This is a test post posted by the testing framework. [attachment=0]Attachment #0[/attachment]');
|
||||
$crawler = self::request('GET', "viewtopic.php?p={$post2['post_id']}&sid={$this->sid}");
|
||||
|
||||
self::assertContains('Re: Feeds #1 - Topic #3-1', $crawler->filter('html')->text());
|
||||
self::assertStringContainsString('Re: Feeds #1 - Topic #3-1', $crawler->filter('html')->text());
|
||||
$this->data['posts']['Re: Feeds #1 - Topic #3-1'] = (int) $post2['post_id'];
|
||||
}
|
||||
|
||||
|
@ -1395,7 +1397,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
|
|||
foreach($data['contents'] as $entry_id => $string)
|
||||
{
|
||||
$content = $crawler->filterXPath("//entry[{$entry_id}]/content")->text();
|
||||
self::assertContains($string, $content, "Tested feed : 'app.php/feed{$params}'");
|
||||
self::assertStringContainsString($string, $content, "Tested feed : 'app.php/feed{$params}'");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1420,13 +1422,13 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
|
|||
|
||||
if ($attachment['displayed'])
|
||||
{
|
||||
self::assertContains($url, $content, "Tested feed : 'app.php/feed{$params}'");
|
||||
self::assertNotContains($string, $content, "Tested feed : 'app.php/feed{$params}'");
|
||||
self::assertStringContainsString($url, $content, "Tested feed : 'app.php/feed{$params}'");
|
||||
self::assertStringNotContainsString($string, $content, "Tested feed : 'app.php/feed{$params}'");
|
||||
}
|
||||
else
|
||||
{
|
||||
self::assertContains($string, $content, "Tested feed : 'app.php/feed{$params}'");
|
||||
self::assertNotContains($url, $content, "Tested feed : 'app.php/feed{$params}'");
|
||||
self::assertStringContainsString($string, $content, "Tested feed : 'app.php/feed{$params}'");
|
||||
self::assertStringNotContainsString($url, $content, "Tested feed : 'app.php/feed{$params}'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -143,7 +143,7 @@ class phpbb_functional_fileupload_form_test extends phpbb_functional_test_case
|
|||
$crawler = $this->upload_file('valid.jpg', 'image/jpeg');
|
||||
|
||||
// Ensure there was no error message rendered
|
||||
$this->assertNotContains('<h2>' . $this->lang('INFORMATION') . '</h2>', $this->get_content());
|
||||
$this->assertStringNotContainsString('<h2>' . $this->lang('INFORMATION') . '</h2>', $this->get_content());
|
||||
|
||||
// Also the file name should be in the first row of the files table
|
||||
$this->assertEquals('valid.jpg', $crawler->filter('span.file-name')->eq(1)->text());
|
||||
|
|
|
@ -40,7 +40,7 @@ class phpbb_functional_forgot_password_test extends phpbb_functional_test_case
|
|||
$this->logout();
|
||||
|
||||
$crawler = self::request('GET', 'app.php/user/forgot_password');
|
||||
$this->assertContains($this->lang('UCP_PASSWORD_RESET_DISABLED', '', ''), $crawler->text());
|
||||
$this->assertStringContainsString($this->lang('UCP_PASSWORD_RESET_DISABLED', '', ''), $crawler->text());
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -19,13 +19,13 @@ class phpbb_functional_forum_style_test extends phpbb_functional_test_case
|
|||
public function test_default_forum_style()
|
||||
{
|
||||
$crawler = self::request('GET', 'viewtopic.php?t=1&f=2');
|
||||
$this->assertContains('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href'));
|
||||
$this->assertStringContainsString('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href'));
|
||||
|
||||
$crawler = self::request('GET', 'viewtopic.php?t=1');
|
||||
$this->assertContains('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href'));
|
||||
$this->assertStringContainsString('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href'));
|
||||
|
||||
$crawler = self::request('GET', 'viewtopic.php?t=1&view=next');
|
||||
$this->assertContains('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href'));
|
||||
$this->assertStringContainsString('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href'));
|
||||
}
|
||||
|
||||
public function test_custom_forum_style()
|
||||
|
@ -35,13 +35,13 @@ class phpbb_functional_forum_style_test extends phpbb_functional_test_case
|
|||
$db->sql_query('UPDATE ' . FORUMS_TABLE . ' SET forum_style = 2 WHERE forum_id = 2');
|
||||
|
||||
$crawler = self::request('GET', 'viewtopic.php?t=1&f=2');
|
||||
$this->assertContains('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href'));
|
||||
$this->assertStringContainsString('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href'));
|
||||
|
||||
$crawler = self::request('GET', 'viewtopic.php?t=1');
|
||||
$this->assertContains('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href'));
|
||||
$this->assertStringContainsString('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href'));
|
||||
|
||||
$crawler = self::request('GET', 'viewtopic.php?t=1&view=next');
|
||||
$this->assertContains('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href'));
|
||||
$this->assertStringContainsString('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href'));
|
||||
|
||||
$db->sql_query('UPDATE ' . FORUMS_TABLE . ' SET forum_style = 0 WHERE forum_id = 2');
|
||||
$this->delete_style(2, 'test_style');
|
||||
|
|
|
@ -30,6 +30,6 @@ class phpbb_functional_jumpbox_test extends phpbb_functional_test_case
|
|||
|
||||
protected function check_valid_jump($forum)
|
||||
{
|
||||
$this->assertContains($this->lang('FORUM') . ": $forum", $this->crawler->filter('#cp-main h2')->text(), $this->crawler->text());
|
||||
$this->assertStringContainsString($this->lang('FORUM') . ": $forum", $this->crawler->filter('#cp-main h2')->text(), $this->crawler->text());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,11 +22,9 @@ class phpbb_functional_lang_test extends phpbb_functional_test_case
|
|||
$this->assertEquals('Board index', $this->lang('FORUM_INDEX'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException RuntimeException
|
||||
*/
|
||||
public function test_lang_missing()
|
||||
{
|
||||
$this->expectException('RuntimeException');
|
||||
$this->assertEquals('Your account has now been activated. Thank you for registering.', $this->lang('ACCOUNT_ACTIVE'));
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ class phpbb_functional_mcp_test extends phpbb_functional_test_case
|
|||
$post = $this->create_topic(2, 'Test Topic 2', 'Testing move post with "Move posts" option from Quick-Moderator Tools.');
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
|
||||
$this->assertContains('Testing move post with "Move posts" option from Quick-Moderator Tools.', $crawler->filter('html')->text());
|
||||
$this->assertStringContainsString('Testing move post with "Move posts" option from Quick-Moderator Tools.', $crawler->filter('html')->text());
|
||||
|
||||
return $crawler;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ class phpbb_functional_mcp_test extends phpbb_functional_test_case
|
|||
));
|
||||
$form['post_id_list'][0]->tick();
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContains($this->lang('MERGE_POSTS'), $crawler->filter('html')->text());
|
||||
$this->assertStringContainsString($this->lang('MERGE_POSTS'), $crawler->filter('html')->text());
|
||||
|
||||
return $crawler;
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ class phpbb_functional_mcp_test extends phpbb_functional_test_case
|
|||
$this->add_lang('mcp');
|
||||
$form = $crawler->selectButton('Yes')->form();
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContains($this->lang('POSTS_MERGED_SUCCESS'), $crawler->text());
|
||||
$this->assertStringContainsString($this->lang('POSTS_MERGED_SUCCESS'), $crawler->text());
|
||||
}
|
||||
|
||||
public function test_delete_logs()
|
||||
|
|
|
@ -22,15 +22,15 @@ class phpbb_functional_memberlist_test extends phpbb_functional_test_case
|
|||
// logs in as admin
|
||||
$this->login();
|
||||
$crawler = self::request('GET', 'memberlist.php?sid=' . $this->sid);
|
||||
$this->assertContains('memberlist-test-user', $crawler->text());
|
||||
$this->assertStringContainsString('memberlist-test-user', $crawler->text());
|
||||
|
||||
// restrict by first character
|
||||
$crawler = self::request('GET', 'memberlist.php?first_char=m&sid=' . $this->sid);
|
||||
$this->assertContains('memberlist-test-user', $crawler->text());
|
||||
$this->assertStringContainsString('memberlist-test-user', $crawler->text());
|
||||
|
||||
// make sure results for wrong character are not returned
|
||||
$crawler = self::request('GET', 'memberlist.php?first_char=a&sid=' . $this->sid);
|
||||
$this->assertNotContains('memberlist-test-user', $crawler->text());
|
||||
$this->assertStringNotContainsString('memberlist-test-user', $crawler->text());
|
||||
}
|
||||
|
||||
public function test_viewprofile()
|
||||
|
@ -38,7 +38,7 @@ class phpbb_functional_memberlist_test extends phpbb_functional_test_case
|
|||
$this->login();
|
||||
// XXX hardcoded user id
|
||||
$crawler = self::request('GET', 'memberlist.php?mode=viewprofile&u=2&sid=' . $this->sid);
|
||||
$this->assertContains('admin', $crawler->filter('h2')->text());
|
||||
$this->assertStringContainsString('admin', $crawler->filter('h2')->text());
|
||||
}
|
||||
|
||||
protected function get_memberlist_leaders_table_crawler()
|
||||
|
@ -55,16 +55,16 @@ class phpbb_functional_memberlist_test extends phpbb_functional_test_case
|
|||
$crawler = $this->get_memberlist_leaders_table_crawler();
|
||||
|
||||
// Admin in admin group, but not in moderators
|
||||
$this->assertContains('admin', $crawler->eq(0)->text());
|
||||
$this->assertNotContains('admin', $crawler->eq(1)->text());
|
||||
$this->assertStringContainsString('admin', $crawler->eq(0)->text());
|
||||
$this->assertStringNotContainsString('admin', $crawler->eq(1)->text());
|
||||
|
||||
// memberlist-test-user in neither group
|
||||
$this->assertNotContains('memberlist-test-user', $crawler->eq(0)->text());
|
||||
$this->assertNotContains('memberlist-test-user', $crawler->eq(1)->text());
|
||||
$this->assertStringNotContainsString('memberlist-test-user', $crawler->eq(0)->text());
|
||||
$this->assertStringNotContainsString('memberlist-test-user', $crawler->eq(1)->text());
|
||||
|
||||
// memberlist-test-moderator in neither group
|
||||
$this->assertNotContains('memberlist-test-moderator', $crawler->eq(0)->text());
|
||||
$this->assertNotContains('memberlist-test-moderator', $crawler->eq(1)->text());
|
||||
$this->assertStringNotContainsString('memberlist-test-moderator', $crawler->eq(0)->text());
|
||||
$this->assertStringNotContainsString('memberlist-test-moderator', $crawler->eq(1)->text());
|
||||
}
|
||||
|
||||
public function test_leaders_remove_users()
|
||||
|
@ -74,14 +74,14 @@ class phpbb_functional_memberlist_test extends phpbb_functional_test_case
|
|||
// Remove admin from admins, but is now in moderators
|
||||
$this->remove_user_group('ADMINISTRATORS', array('admin'));
|
||||
$crawler = $this->get_memberlist_leaders_table_crawler();
|
||||
$this->assertNotContains('admin', $crawler->eq(0)->text());
|
||||
$this->assertContains('admin', $crawler->eq(1)->text());
|
||||
$this->assertStringNotContainsString('admin', $crawler->eq(0)->text());
|
||||
$this->assertStringContainsString('admin', $crawler->eq(1)->text());
|
||||
|
||||
// Remove admin from moderators, should not be visible anymore
|
||||
$this->remove_user_group('GLOBAL_MODERATORS', array('admin'));
|
||||
$crawler = $this->get_memberlist_leaders_table_crawler();
|
||||
$this->assertNotContains('admin', $crawler->eq(0)->text());
|
||||
$this->assertNotContains('admin', $crawler->eq(1)->text());
|
||||
$this->assertStringNotContainsString('admin', $crawler->eq(0)->text());
|
||||
$this->assertStringNotContainsString('admin', $crawler->eq(1)->text());
|
||||
}
|
||||
|
||||
public function test_leaders_add_users()
|
||||
|
@ -91,20 +91,20 @@ class phpbb_functional_memberlist_test extends phpbb_functional_test_case
|
|||
// Add memberlist-test-moderator to moderators
|
||||
$this->add_user_group('GLOBAL_MODERATORS', array('memberlist-test-moderator'));
|
||||
$crawler = $this->get_memberlist_leaders_table_crawler();
|
||||
$this->assertNotContains('memberlist-test-moderator', $crawler->eq(0)->text());
|
||||
$this->assertContains('memberlist-test-moderator', $crawler->eq(1)->text());
|
||||
$this->assertStringNotContainsString('memberlist-test-moderator', $crawler->eq(0)->text());
|
||||
$this->assertStringContainsString('memberlist-test-moderator', $crawler->eq(1)->text());
|
||||
|
||||
// Add admin to moderators, should be visible as moderator
|
||||
$this->add_user_group('GLOBAL_MODERATORS', array('admin'), true);
|
||||
$crawler = $this->get_memberlist_leaders_table_crawler();
|
||||
$this->assertNotContains('admin', $crawler->eq(0)->text());
|
||||
$this->assertContains('admin', $crawler->eq(1)->text());
|
||||
$this->assertStringNotContainsString('admin', $crawler->eq(0)->text());
|
||||
$this->assertStringContainsString('admin', $crawler->eq(1)->text());
|
||||
|
||||
// Add admin to admins as leader, should be visible as admin, not moderator
|
||||
$this->add_user_group('ADMINISTRATORS', array('admin'), true, true);
|
||||
$crawler = $this->get_memberlist_leaders_table_crawler();
|
||||
$this->assertContains('admin', $crawler->eq(0)->text());
|
||||
$this->assertNotContains('admin', $crawler->eq(1)->text());
|
||||
$this->assertStringContainsString('admin', $crawler->eq(0)->text());
|
||||
$this->assertStringNotContainsString('admin', $crawler->eq(1)->text());
|
||||
}
|
||||
|
||||
public function test_group_rank()
|
||||
|
@ -130,7 +130,7 @@ class phpbb_functional_memberlist_test extends phpbb_functional_test_case
|
|||
$this->assertContainsLang('RANK_UPDATED', $crawler->filter('.successbox')->text());
|
||||
|
||||
$crawler = self::request('GET', 'memberlist.php?mode=group&g=2');
|
||||
$this->assertContains('memberlist-test-user', $crawler->text());
|
||||
$this->assertStringContainsString('memberlist-test-user', $crawler->text());
|
||||
|
||||
unlink(__DIR__ . '/../../phpBB/images/ranks/valid.jpg');
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ class phpbb_functional_metadata_manager_test extends phpbb_functional_test_case
|
|||
parent::tearDown();
|
||||
}
|
||||
|
||||
static public function setUpBeforeClass()
|
||||
static public function setUpBeforeClass(): void
|
||||
{
|
||||
parent::setUpBeforeClass();
|
||||
|
||||
|
@ -39,7 +39,7 @@ class phpbb_functional_metadata_manager_test extends phpbb_functional_test_case
|
|||
self::$helper->copy_ext_fixtures(dirname(__FILE__) . '/fixtures/ext/', self::$fixtures);
|
||||
}
|
||||
|
||||
static public function tearDownAfterClass()
|
||||
static public function tearDownAfterClass(): void
|
||||
{
|
||||
parent::tearDownAfterClass();
|
||||
|
||||
|
@ -63,9 +63,9 @@ class phpbb_functional_metadata_manager_test extends phpbb_functional_test_case
|
|||
public function test_extensions_list()
|
||||
{
|
||||
$crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&sid=' . $this->sid);
|
||||
$this->assertContains($this->lang('EXTENSIONS_EXPLAIN'), $crawler->filter('#main')->text());
|
||||
$this->assertContains('phpBB 3.1 Extension Testing', $crawler->filter('#main')->text());
|
||||
$this->assertContains('Details', $crawler->filter('#main')->text());
|
||||
$this->assertStringContainsString($this->lang('EXTENSIONS_EXPLAIN'), $crawler->filter('#main')->text());
|
||||
$this->assertStringContainsString('phpBB 3.1 Extension Testing', $crawler->filter('#main')->text());
|
||||
$this->assertStringContainsString('Details', $crawler->filter('#main')->text());
|
||||
}
|
||||
|
||||
public function test_extensions_details()
|
||||
|
@ -73,15 +73,15 @@ class phpbb_functional_metadata_manager_test extends phpbb_functional_test_case
|
|||
$crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=details&ext_name=foo%2Fbar&sid=' . $this->sid);
|
||||
|
||||
// Test whether the details are displayed
|
||||
$this->assertContains($this->lang('CLEAN_NAME'), $crawler->filter('#main')->text());
|
||||
$this->assertContains('foo/bar', $crawler->filter('#meta_name')->text());
|
||||
$this->assertStringContainsString($this->lang('CLEAN_NAME'), $crawler->filter('#main')->text());
|
||||
$this->assertStringContainsString('foo/bar', $crawler->filter('#meta_name')->text());
|
||||
|
||||
$this->assertContains($this->lang('PHP_VERSION'), $crawler->filter('#main')->text());
|
||||
$this->assertContains('>=5.3', $crawler->filter('#require_php')->text());
|
||||
$this->assertStringContainsString($this->lang('PHP_VERSION'), $crawler->filter('#main')->text());
|
||||
$this->assertStringContainsString('>=5.3', $crawler->filter('#require_php')->text());
|
||||
// Details should be html escaped
|
||||
// However, text() only returns the displayed text, so HTML Special Chars are decoded.
|
||||
// So we test this directly on the content of the response.
|
||||
$this->assertContains('<span id="require_php">>=5.3</span>', $this->get_content());
|
||||
$this->assertStringContainsString('<span id="require_php">>=5.3</span>', $this->get_content());
|
||||
}
|
||||
|
||||
public function test_extensions_details_notexists()
|
||||
|
@ -89,6 +89,6 @@ class phpbb_functional_metadata_manager_test extends phpbb_functional_test_case
|
|||
$crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=details&ext_name=not%2Fexists&sid=' . $this->sid);
|
||||
|
||||
// Error message because the files do not exist
|
||||
$this->assertContains($this->lang('FILE_NOT_FOUND', ''), $crawler->filter('#main')->text());
|
||||
$this->assertStringContainsString($this->lang('FILE_NOT_FOUND', ''), $crawler->filter('#main')->text());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ class phpbb_functional_notification_test extends phpbb_functional_test_case
|
|||
// Post a new post that needs approval
|
||||
$this->create_post(2, 1, 'Re: Welcome to phpBB3', 'This is a test [b]post[/b] posted by notificationtestuser.', array(), 'POST_STORED_MOD');
|
||||
$crawler = self::request('GET', "viewtopic.php?t=1&sid={$this->sid}");
|
||||
$this->assertNotContains('This is a test post posted by notificationtestuser.', $crawler->filter('html')->text());
|
||||
$this->assertStringNotContainsString('This is a test post posted by notificationtestuser.', $crawler->filter('html')->text());
|
||||
|
||||
// Login as admin
|
||||
$this->logout();
|
||||
|
|
|
@ -27,17 +27,17 @@ class phpbb_functional_paging_test extends phpbb_functional_test_case
|
|||
$this->create_post(2, $post['topic_id'], 'Re: Test Topic 1', 'This is a test post no' . $post_id . ' posted by the testing framework.');
|
||||
}
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
|
||||
$this->assertContains('post no4', $crawler->text());
|
||||
$this->assertNotContains('post no16', $crawler->text());
|
||||
$this->assertStringContainsString('post no4', $crawler->text());
|
||||
$this->assertStringNotContainsString('post no16', $crawler->text());
|
||||
|
||||
$next_link = $crawler->filter('.pagination > ul > li.next > a')->attr('href');
|
||||
$crawler = self::request('GET', $next_link);
|
||||
$this->assertNotContains('post no4', $crawler->text());
|
||||
$this->assertContains('post no16', $crawler->text());
|
||||
$this->assertStringNotContainsString('post no4', $crawler->text());
|
||||
$this->assertStringContainsString('post no16', $crawler->text());
|
||||
|
||||
$prev_link = $crawler->filter('.pagination > ul > li.previous > a')->attr('href');
|
||||
$crawler = self::request('GET', $prev_link);
|
||||
$this->assertContains('post no4', $crawler->text());
|
||||
$this->assertNotContains('post no16', $crawler->text());
|
||||
$this->assertStringContainsString('post no4', $crawler->text());
|
||||
$this->assertStringNotContainsString('post no16', $crawler->text());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ class phpbb_functional_plupload_test extends phpbb_functional_test_case
|
|||
|
||||
if ($i < self::CHUNKS - 1)
|
||||
{
|
||||
$this->assertContains('{"jsonrpc":"2.0","id":"id","result":null}', self::get_content());
|
||||
$this->assertStringContainsString('{"jsonrpc":"2.0","id":"id","result":null}', self::get_content());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -24,17 +24,17 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
|
|||
$post = $this->create_topic(2, 'Test Topic 1', 'This is a test topic posted by the testing framework.');
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
|
||||
$this->assertContains('This is a test topic posted by the testing framework.', $crawler->filter('html')->text());
|
||||
$this->assertStringContainsString('This is a test topic posted by the testing framework.', $crawler->filter('html')->text());
|
||||
|
||||
// Test creating a reply with bbcode
|
||||
$post2 = $this->create_post(2, $post['topic_id'], 'Re: Test Topic 1', 'This is a test [b]post[/b] posted by the testing framework.');
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?p={$post2['post_id']}&sid={$this->sid}");
|
||||
$this->assertContains('This is a test post posted by the testing framework.', $crawler->filter('html')->text());
|
||||
$this->assertStringContainsString('This is a test post posted by the testing framework.', $crawler->filter('html')->text());
|
||||
|
||||
// Test quoting a message
|
||||
$crawler = self::request('GET', "posting.php?mode=quote&f=2&t={$post2['topic_id']}&p={$post2['post_id']}&sid={$this->sid}");
|
||||
$this->assertContains('This is a test post posted by the testing framework.', $crawler->filter('html')->text());
|
||||
$this->assertStringContainsString('This is a test post posted by the testing framework.', $crawler->filter('html')->text());
|
||||
}
|
||||
|
||||
public function test_unsupported_characters()
|
||||
|
@ -44,7 +44,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
|
|||
$post = $this->create_topic(2, "Test Topic \xF0\x9F\xA4\x94 3\xF0\x9D\x94\xBB\xF0\x9D\x95\x9A", 'This is a test with emoji character in the topic title.');
|
||||
$this->create_post(2, $post['topic_id'], "Re: Test Topic 1 \xF0\x9F\xA4\x94 3\xF0\x9D\x94\xBB\xF0\x9D\x95\x9A", 'This is a test with emoji characters in the topic title.');
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
|
||||
$this->assertContains("\xF0\x9F\xA4\x94 3\xF0\x9D\x94\xBB\xF0\x9D\x95\x9A", $crawler->text());
|
||||
$this->assertStringContainsString("\xF0\x9F\xA4\x94 3\xF0\x9D\x94\xBB\xF0\x9D\x95\x9A", $crawler->text());
|
||||
}
|
||||
|
||||
public function test_supported_unicode_characters()
|
||||
|
@ -54,7 +54,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
|
|||
$post = $this->create_topic(2, 'Test Topic 1', 'This is a test topic posted by the testing framework.');
|
||||
$this->create_post(2, $post['topic_id'], 'Re: Test Topic 1', "This is a test with these weird characters: \xF0\x9F\x84\x90 \xF0\x9F\x84\x91");
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
|
||||
$this->assertContains("\xF0\x9F\x84\x90 \xF0\x9F\x84\x91", $crawler->text());
|
||||
$this->assertStringContainsString("\xF0\x9F\x84\x90 \xF0\x9F\x84\x91", $crawler->text());
|
||||
}
|
||||
|
||||
public function test_html_entities()
|
||||
|
@ -64,7 +64,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
|
|||
$post = $this->create_topic(2, 'Test Topic 1', 'This is a test topic posted by the testing framework.');
|
||||
$this->create_post(2, $post['topic_id'], 'Re: Test Topic 1', '😀');
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
|
||||
$this->assertContains('😀', $crawler->text());
|
||||
$this->assertStringContainsString('😀', $crawler->text());
|
||||
}
|
||||
|
||||
public function test_quote()
|
||||
|
@ -96,7 +96,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
|
|||
$form->setValues(array('message' => 'Edited post'));
|
||||
$crawler = self::submit($form);
|
||||
|
||||
$this->assertContains('Edited post', $crawler->filter("#post_content{$post_id} .content")->text());
|
||||
$this->assertStringContainsString('Edited post', $crawler->filter("#post_content{$post_id} .content")->text());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -163,11 +163,11 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
|
|||
$text_content = $crawler->filter('#p' . $post['post_id'])->text();
|
||||
foreach ($contains[$quote_depth] as $contains_text)
|
||||
{
|
||||
$this->assertContains($contains_text, $text_content);
|
||||
$this->assertStringContainsString($contains_text, $text_content);
|
||||
}
|
||||
foreach ($not_contains[$quote_depth] as $not_contains_text)
|
||||
{
|
||||
$this->assertNotContains($not_contains_text, $text_content);
|
||||
$this->assertStringNotContainsString($not_contains_text, $text_content);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -229,7 +229,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
|
|||
'message' => 'My post',
|
||||
));
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContains(
|
||||
$this->assertStringContainsString(
|
||||
'<strong class="text-strong">My signature</strong>',
|
||||
$crawler->filter('#preview .signature')->html()
|
||||
);
|
||||
|
@ -274,7 +274,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
|
|||
'message' => $text,
|
||||
));
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContains(
|
||||
$this->assertStringContainsString(
|
||||
'<a href="http://example.org/" class="postlink">http://example.org/</a> tcp://localhost:22/ServiceName',
|
||||
$crawler->filter('#preview .content')->html()
|
||||
);
|
||||
|
@ -295,7 +295,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
|
|||
'message' => $text,
|
||||
));
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContains(
|
||||
$this->assertStringContainsString(
|
||||
'http://example.org/ <a href="tcp://localhost:22/ServiceName" class="postlink">tcp://localhost:22/ServiceName</a>',
|
||||
$crawler->filter('#preview .content')->html()
|
||||
);
|
||||
|
|
|
@ -32,7 +32,7 @@ class phpbb_functional_private_messages_test extends phpbb_functional_test_case
|
|||
$form->setValues($values);
|
||||
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContains($this->lang('CONFIG_UPDATED'), $crawler->filter('.successbox')->text());
|
||||
$this->assertStringContainsString($this->lang('CONFIG_UPDATED'), $crawler->filter('.successbox')->text());
|
||||
}
|
||||
|
||||
public function test_inbox_full()
|
||||
|
@ -41,12 +41,12 @@ class phpbb_functional_private_messages_test extends phpbb_functional_test_case
|
|||
$message_id = $this->create_private_message('Test private message #1', 'This is a test private message sent by the testing framework.', array(2));
|
||||
|
||||
$crawler = self::request('GET', "ucp.php?i=pm&mode=view&sid{$this->sid}&p={$message_id}");
|
||||
$this->assertContains($this->lang('UCP_PM_VIEW'), $crawler->filter('html')->text());
|
||||
$this->assertStringContainsString($this->lang('UCP_PM_VIEW'), $crawler->filter('html')->text());
|
||||
|
||||
$message_id = $this->create_private_message('Test private message #2', 'This is a test private message sent by the testing framework.', array(2));
|
||||
|
||||
$crawler = self::request('GET', "ucp.php?i=pm&mode=view&sid{$this->sid}&p={$message_id}");
|
||||
$this->assertContains($this->lang('NO_AUTH_READ_HOLD_MESSAGE'), $crawler->filter('html')->text());
|
||||
$this->assertStringContainsString($this->lang('NO_AUTH_READ_HOLD_MESSAGE'), $crawler->filter('html')->text());
|
||||
}
|
||||
|
||||
public function test_restore_config()
|
||||
|
@ -64,7 +64,7 @@ class phpbb_functional_private_messages_test extends phpbb_functional_test_case
|
|||
$form->setValues($values);
|
||||
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContains($this->lang('CONFIG_UPDATED'), $crawler->filter('.successbox')->text());
|
||||
$this->assertStringContainsString($this->lang('CONFIG_UPDATED'), $crawler->filter('.successbox')->text());
|
||||
}
|
||||
|
||||
public function test_quote_post()
|
||||
|
@ -105,6 +105,6 @@ class phpbb_functional_private_messages_test extends phpbb_functional_test_case
|
|||
|
||||
$crawler = self::request('GET', 'ucp.php?i=pm&mode=compose&action=forward&f=0&p=' . $message_id . '&sid=' . $this->sid);
|
||||
|
||||
$this->assertContains($expected, $crawler->filter('textarea#message')->text());
|
||||
$this->assertStringContainsString($expected, $crawler->filter('textarea#message')->text());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ class phpbb_functional_prune_shadow_topic_test extends phpbb_functional_test_cas
|
|||
$this->post = $this->create_topic($this->data['forums']['Prune Shadow'], 'Prune Shadow #1', 'This is a test topic posted by the testing framework.');
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->post['topic_id']}&sid={$this->sid}");
|
||||
|
||||
$this->assertContains('Prune Shadow #1', $crawler->filter('html')->text());
|
||||
$this->assertStringContainsString('Prune Shadow #1', $crawler->filter('html')->text());
|
||||
$this->data['topics']['Prune Shadow #1'] = (int) $this->post['topic_id'];
|
||||
$this->data['posts']['Prune Shadow #1'] = (int) $this->get_parameter_from_link($crawler->filter('.post')->selectLink($this->lang('POST', '', ''))->link()->getUri(), 'p');
|
||||
|
||||
|
@ -79,7 +79,7 @@ class phpbb_functional_prune_shadow_topic_test extends phpbb_functional_test_cas
|
|||
$post2 = $this->create_post($this->data['forums']['Prune Shadow'], $this->post['topic_id'], 'Re: Prune Shadow #1-#2', 'This is a test post posted by the testing framework.');
|
||||
$crawler = self::request('GET', "viewtopic.php?p={$post2['post_id']}&sid={$this->sid}");
|
||||
|
||||
$this->assertContains('Re: Prune Shadow #1-#2', $crawler->filter('html')->text());
|
||||
$this->assertStringContainsString('Re: Prune Shadow #1-#2', $crawler->filter('html')->text());
|
||||
$this->data['posts']['Re: Prune Shadow #1-#2'] = (int) $post2['post_id'];
|
||||
|
||||
$this->assert_forum_details($this->data['forums']['Prune Shadow'], array(
|
||||
|
|
|
@ -21,11 +21,11 @@ class phpbb_functional_report_post_captcha_test extends phpbb_functional_test_ca
|
|||
$crawler = self::request('GET', 'app.php/post/1/report', array(), false);
|
||||
$this->assert_response_html(403);
|
||||
$this->add_lang('mcp');
|
||||
$this->assertContains($this->lang('USER_CANNOT_REPORT'), $crawler->filter('html')->text());
|
||||
$this->assertStringContainsString($this->lang('USER_CANNOT_REPORT'), $crawler->filter('html')->text());
|
||||
|
||||
$this->set_reporting_guest(1);
|
||||
$crawler = self::request('GET', 'app.php/post/1/report');
|
||||
$this->assertContains($this->lang('CONFIRM_CODE'), $crawler->filter('html')->text());
|
||||
$this->assertStringContainsString($this->lang('CONFIRM_CODE'), $crawler->filter('html')->text());
|
||||
$this->set_reporting_guest(-1);
|
||||
}
|
||||
|
||||
|
@ -33,12 +33,12 @@ class phpbb_functional_report_post_captcha_test extends phpbb_functional_test_ca
|
|||
{
|
||||
$this->login();
|
||||
$crawler = self::request('GET', 'app.php/post/1/report');
|
||||
$this->assertNotContains($this->lang('CONFIRM_CODE'), $crawler->filter('html')->text());
|
||||
$this->assertStringNotContainsString($this->lang('CONFIRM_CODE'), $crawler->filter('html')->text());
|
||||
|
||||
$this->add_lang('mcp');
|
||||
$form = $crawler->selectButton($this->lang('SUBMIT'))->form();
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContains($this->lang('POST_REPORTED_SUCCESS'), $crawler->text());
|
||||
$this->assertStringContainsString($this->lang('POST_REPORTED_SUCCESS'), $crawler->text());
|
||||
}
|
||||
|
||||
protected function set_reporting_guest($report_post_allowed)
|
||||
|
|
|
@ -64,8 +64,8 @@ class phpbb_functional_subforum_test extends phpbb_functional_test_case
|
|||
public function test_display_subforums()
|
||||
{
|
||||
$crawler = self::request('GET', "index.php?sid={$this->sid}");
|
||||
$this->assertContains('Subforum Test #1.1', $crawler->html());
|
||||
$this->assertContains('Subforum Test #1.1.1', $crawler->html());
|
||||
$this->assertStringContainsString('Subforum Test #1.1', $crawler->html());
|
||||
$this->assertStringContainsString('Subforum Test #1.1.1', $crawler->html());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -85,8 +85,8 @@ class phpbb_functional_subforum_test extends phpbb_functional_test_case
|
|||
self::submit($form);
|
||||
|
||||
$crawler = self::request('GET', "index.php?sid={$this->sid}");
|
||||
$this->assertContains('Subforum Test #1.1', $crawler->html());
|
||||
$this->assertNotContains('Subforum Test #1.1.1', $crawler->html());
|
||||
$this->assertStringContainsString('Subforum Test #1.1', $crawler->html());
|
||||
$this->assertStringNotContainsString('Subforum Test #1.1.1', $crawler->html());
|
||||
}
|
||||
|
||||
protected function get_forum_id($forum_name)
|
||||
|
|
|
@ -22,9 +22,9 @@ class phpbb_functional_ucp_allow_pm_test extends phpbb_functional_test_case
|
|||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->backupStaticAttributesBlacklist += array(
|
||||
'phpbb_functional_ucp_allow_pm_test' => array('data'),
|
||||
);
|
||||
$this->excludeBackupStaticAttributes([
|
||||
'phpbb_functional_ucp_allow_pm_test' => ['data'],
|
||||
]);
|
||||
}
|
||||
|
||||
// user A sends a PM to user B where B accepts PM
|
||||
|
|
|
@ -51,7 +51,7 @@ class phpbb_functional_ucp_groups_test extends phpbb_functional_common_groups_te
|
|||
$form = $this->get_group_manage_form();
|
||||
$teampage_settings = $this->get_teampage_settings();
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContains($this->lang('GROUP_UPDATED'), $crawler->text());
|
||||
$this->assertStringContainsString($this->lang('GROUP_UPDATED'), $crawler->text());
|
||||
$this->assertEquals($teampage_settings, $this->get_teampage_settings());
|
||||
}
|
||||
|
||||
|
|
|
@ -86,14 +86,14 @@ class phpbb_functional_ucp_profile_test extends phpbb_functional_test_case
|
|||
$key_id = substr($db->sql_fetchfield('key_id'), 0, 8);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$this->assertContains($key_id, $crawler->filter('label[for="' . $key_id . '"]')->text());
|
||||
$this->assertStringContainsString($key_id, $crawler->filter('label[for="' . $key_id . '"]')->text());
|
||||
|
||||
$form = $crawler->selectButton('submit')->form();
|
||||
$form['keys'][0]->tick();
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContains($this->lang('AUTOLOGIN_SESSION_KEYS_DELETED'), $crawler->filter('html')->text());
|
||||
$this->assertStringContainsString($this->lang('AUTOLOGIN_SESSION_KEYS_DELETED'), $crawler->filter('html')->text());
|
||||
|
||||
$crawler = self::request('GET', 'ucp.php?i=ucp_profile&mode=autologin_keys');
|
||||
$this->assertContains($this->lang('PROFILE_NO_AUTOLOGIN_KEYS'), $crawler->filter('tbody > tr > td[class="bg1"]')->text());
|
||||
$this->assertStringContainsString($this->lang('PROFILE_NO_AUTOLOGIN_KEYS'), $crawler->filter('tbody > tr > td[class="bg1"]')->text());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ class phpbb_functional_user_password_reset_test extends phpbb_functional_test_ca
|
|||
|
||||
// test without email
|
||||
$crawler = self::request('GET', "ucp.php?mode=sendpassword&sid={$this->sid}");
|
||||
$this->assertContains('app.php/user/forgot_password', $crawler->getUri());
|
||||
$this->assertStringContainsString('app.php/user/forgot_password', $crawler->getUri());
|
||||
$form = $crawler->selectButton('submit')->form();
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContainsLang('NO_EMAIL_USER', $crawler->text());
|
||||
|
@ -143,11 +143,11 @@ class phpbb_functional_user_password_reset_test extends phpbb_functional_test_ca
|
|||
{
|
||||
$this->add_lang('ucp');
|
||||
$crawler = self::request('GET', 'ucp.php');
|
||||
$this->assertContains($this->lang('LOGIN_EXPLAIN_UCP'), $crawler->filter('html')->text());
|
||||
$this->assertStringContainsString($this->lang('LOGIN_EXPLAIN_UCP'), $crawler->filter('html')->text());
|
||||
|
||||
$form = $crawler->selectButton($this->lang('LOGIN'))->form();
|
||||
$crawler = self::submit($form, array('username' => 'reset-password-test-user', 'password' => 'reset-password-test-user'));
|
||||
$this->assertNotContains($this->lang('LOGIN'), $crawler->filter('.navbar')->text());
|
||||
$this->assertStringNotContainsString($this->lang('LOGIN'), $crawler->filter('.navbar')->text());
|
||||
|
||||
$cookies = self::$cookieJar->all();
|
||||
|
||||
|
@ -163,12 +163,12 @@ class phpbb_functional_user_password_reset_test extends phpbb_functional_test_ca
|
|||
$this->logout();
|
||||
|
||||
$crawler = self::request('GET', 'ucp.php');
|
||||
$this->assertContains($this->lang('LOGIN_EXPLAIN_UCP'), $crawler->filter('html')->text());
|
||||
$this->assertStringContainsString($this->lang('LOGIN_EXPLAIN_UCP'), $crawler->filter('html')->text());
|
||||
|
||||
$form = $crawler->selectButton($this->lang('LOGIN'))->form();
|
||||
// Try logging in with the old password
|
||||
$crawler = self::submit($form, array('username' => 'reset-password-test-user', 'password' => 'reset-password-test-userreset-password-test-user'));
|
||||
$this->assertContains($this->lang('LOGIN_ERROR_PASSWORD', '', ''), $crawler->filter('html')->text());
|
||||
$this->assertStringContainsString($this->lang('LOGIN_ERROR_PASSWORD', '', ''), $crawler->filter('html')->text());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -127,8 +127,8 @@ class viewforum_paging_test extends phpbb_functional_test_case
|
|||
$this->assertEquals(2, $crawler->filter('div.pagination')->count());
|
||||
$top_pagination = $crawler->filter('div.pagination')->eq(0);
|
||||
$this->assertEquals(3, $top_pagination->filter('li')->count(), 'Number of pagination items on page 1 does not match');
|
||||
$this->assertContains('1', $top_pagination->filter('li')->eq(0)->text());
|
||||
$this->assertContains('2', $top_pagination->filter('li')->eq(1)->text());
|
||||
$this->assertStringContainsString('1', $top_pagination->filter('li')->eq(0)->text());
|
||||
$this->assertStringContainsString('2', $top_pagination->filter('li')->eq(1)->text());
|
||||
$this->assertContainsLang('NEXT', $top_pagination->filter('li')->eq(2)->text());
|
||||
}
|
||||
|
||||
|
@ -157,8 +157,8 @@ class viewforum_paging_test extends phpbb_functional_test_case
|
|||
$top_pagination = $crawler->filter('div.pagination')->eq(0);
|
||||
$this->assertEquals(3, $top_pagination->filter('li')->count(), 'Number of pagination items on page 2 does not match');
|
||||
$this->assertContainsLang('PREVIOUS', $top_pagination->filter('li')->eq(0)->text());
|
||||
$this->assertContains('1', $top_pagination->filter('li')->eq(1)->text());
|
||||
$this->assertContains('2', $top_pagination->filter('li')->eq(2)->text());
|
||||
$this->assertStringContainsString('1', $top_pagination->filter('li')->eq(1)->text());
|
||||
$this->assertStringContainsString('2', $top_pagination->filter('li')->eq(2)->text());
|
||||
}
|
||||
|
||||
protected function assert_forum_details($forum_id, $details, $additional_error_message = '')
|
||||
|
|
|
@ -60,7 +60,7 @@ class phpbb_functional_visibility_disapprove_test extends phpbb_functional_test_
|
|||
$post = $this->create_topic($this->data['forums']['Disapprove Test #1'], 'Disapprove Test Topic #1', 'This is a test topic posted by the testing framework.');
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
|
||||
|
||||
$this->assertContains('Disapprove Test Topic #1', $crawler->filter('html')->text());
|
||||
$this->assertStringContainsString('Disapprove Test Topic #1', $crawler->filter('html')->text());
|
||||
$this->data['topics']['Disapprove Test Topic #1'] = (int) $post['topic_id'];
|
||||
$this->data['posts']['Disapprove Test Topic #1'] = (int) $this->get_parameter_from_link($crawler->filter('.post')->selectLink($this->lang('POST', '', ''))->link()->getUri(), 'p');
|
||||
|
||||
|
@ -83,7 +83,7 @@ class phpbb_functional_visibility_disapprove_test extends phpbb_functional_test_
|
|||
$post2 = $this->create_post($this->data['forums']['Disapprove Test #1'], $post['topic_id'], 'Re: Disapprove Test Topic #1-#2', 'This is a test post posted by the testing framework.', array(), 'POST_STORED_MOD');
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Disapprove Test Topic #1']}&sid={$this->sid}");
|
||||
$this->assertNotContains('Re: Disapprove Test Topic #1-#2', $crawler->filter('html')->text());
|
||||
$this->assertStringNotContainsString('Re: Disapprove Test Topic #1-#2', $crawler->filter('html')->text());
|
||||
|
||||
$this->assert_forum_details($this->data['forums']['Disapprove Test #1'], array(
|
||||
'forum_posts_approved' => 1,
|
||||
|
@ -99,7 +99,7 @@ class phpbb_functional_visibility_disapprove_test extends phpbb_functional_test_
|
|||
$post = $this->create_topic($this->data['forums']['Disapprove Test #1'], 'Disapprove Test Topic #2', 'This is a test topic posted by the testing framework.', array(), 'POST_STORED_MOD');
|
||||
$crawler = self::request('GET', "viewforum.php?f={$this->data['forums']['Disapprove Test #1']}&sid={$this->sid}");
|
||||
|
||||
$this->assertNotContains('Disapprove Test Topic #2', $crawler->filter('html')->text());
|
||||
$this->assertStringNotContainsString('Disapprove Test Topic #2', $crawler->filter('html')->text());
|
||||
|
||||
$this->assert_forum_details($this->data['forums']['Disapprove Test #1'], array(
|
||||
'forum_posts_approved' => 1,
|
||||
|
@ -155,8 +155,8 @@ class phpbb_functional_visibility_disapprove_test extends phpbb_functional_test_
|
|||
$this->add_lang('viewtopic');
|
||||
$this->add_lang('mcp');
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Disapprove Test Topic #1']}&sid={$this->sid}");
|
||||
$this->assertContains('Disapprove Test Topic #1', $crawler->filter('html')->text());
|
||||
$this->assertContains('Re: Disapprove Test Topic #1-#2', $crawler->filter('html')->text());
|
||||
$this->assertStringContainsString('Disapprove Test Topic #1', $crawler->filter('html')->text());
|
||||
$this->assertStringContainsString('Re: Disapprove Test Topic #1-#2', $crawler->filter('html')->text());
|
||||
|
||||
$form = $crawler->selectButton($this->lang('DISAPPROVE'))->form();
|
||||
$crawler = self::submit($form);
|
||||
|
@ -176,11 +176,11 @@ class phpbb_functional_visibility_disapprove_test extends phpbb_functional_test_
|
|||
|
||||
$link = $crawler->selectLink($this->lang('RETURN_PAGE', '', ''))->link();
|
||||
$link_url = $link->getUri();
|
||||
$this->assertContains('viewtopic.php?f=' . $this->data['forums']['Disapprove Test #1'] . '&t=' . $this->data['topics']['Disapprove Test Topic #1'], $link_url);
|
||||
$this->assertStringContainsString('viewtopic.php?f=' . $this->data['forums']['Disapprove Test #1'] . '&t=' . $this->data['topics']['Disapprove Test Topic #1'], $link_url);
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Disapprove Test Topic #1']}&sid={$this->sid}");
|
||||
$this->assertContains('Disapprove Test Topic #1', $crawler->filter('html')->text());
|
||||
$this->assertNotContains('Re: Disapprove Test Topic #1-#2', $crawler->filter('html')->text());
|
||||
$this->assertStringContainsString('Disapprove Test Topic #1', $crawler->filter('html')->text());
|
||||
$this->assertStringNotContainsString('Re: Disapprove Test Topic #1-#2', $crawler->filter('html')->text());
|
||||
}
|
||||
|
||||
public function test_disapprove_topic()
|
||||
|
@ -214,7 +214,7 @@ class phpbb_functional_visibility_disapprove_test extends phpbb_functional_test_
|
|||
$this->add_lang('viewtopic');
|
||||
$this->add_lang('mcp');
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Disapprove Test Topic #2']}&sid={$this->sid}");
|
||||
$this->assertContains('Disapprove Test Topic #2', $crawler->filter('html')->text());
|
||||
$this->assertStringContainsString('Disapprove Test Topic #2', $crawler->filter('html')->text());
|
||||
|
||||
$form = $crawler->selectButton($this->lang('DISAPPROVE'))->form();
|
||||
$crawler = self::submit($form);
|
||||
|
@ -234,11 +234,11 @@ class phpbb_functional_visibility_disapprove_test extends phpbb_functional_test_
|
|||
|
||||
$link = $crawler->selectLink($this->lang('RETURN_PAGE', '', ''))->link();
|
||||
$link_url = $link->getUri();
|
||||
$this->assertContains('viewforum.php?f=' . $this->data['forums']['Disapprove Test #1'], $link_url);
|
||||
$this->assertStringContainsString('viewforum.php?f=' . $this->data['forums']['Disapprove Test #1'], $link_url);
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Disapprove Test Topic #2']}&sid={$this->sid}", array(), false);
|
||||
self::assert_response_html(404);
|
||||
$this->assertNotContains('Disapprove Test Topic #2', $crawler->filter('html')->text());
|
||||
$this->assertStringNotContainsString('Disapprove Test Topic #2', $crawler->filter('html')->text());
|
||||
}
|
||||
|
||||
protected function assert_forum_details($forum_id, $details, $additional_error_message = '')
|
||||
|
|
|
@ -60,7 +60,7 @@ class phpbb_functional_visibility_reapprove_test extends phpbb_functional_test_c
|
|||
$post = $this->create_topic($this->data['forums']['Reapprove Test #1'], 'Reapprove Test Topic #1', 'This is a test topic posted by the testing framework.');
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
|
||||
|
||||
$this->assertContains('Reapprove Test Topic #1', $crawler->filter('h2')->text());
|
||||
$this->assertStringContainsString('Reapprove Test Topic #1', $crawler->filter('h2')->text());
|
||||
$this->data['topics']['Reapprove Test Topic #1'] = (int) $post['topic_id'];
|
||||
$this->data['posts']['Reapprove Test Topic #1'] = (int) $this->get_parameter_from_link($crawler->filter('.post')->selectLink($this->lang('POST', '', ''))->link()->getUri(), 'p');
|
||||
|
||||
|
@ -83,7 +83,7 @@ class phpbb_functional_visibility_reapprove_test extends phpbb_functional_test_c
|
|||
$post2 = $this->create_post($this->data['forums']['Reapprove Test #1'], $post['topic_id'], 'Re: Reapprove Test Topic #1-#2', 'This is a test post posted by the testing framework.', array(), 'POST_STORED_MOD');
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #1']}&sid={$this->sid}");
|
||||
$this->assertNotContains('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text());
|
||||
$this->assertStringNotContainsString('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text());
|
||||
|
||||
$this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
|
||||
'forum_posts_approved' => 1,
|
||||
|
@ -99,7 +99,7 @@ class phpbb_functional_visibility_reapprove_test extends phpbb_functional_test_c
|
|||
$post = $this->create_topic($this->data['forums']['Reapprove Test #1'], 'Reapprove Test Topic #2', 'This is a test topic posted by the testing framework.', array(), 'POST_STORED_MOD');
|
||||
$crawler = self::request('GET', "viewforum.php?f={$this->data['forums']['Reapprove Test #1']}&sid={$this->sid}");
|
||||
|
||||
$this->assertNotContains('Reapprove Test Topic #2', $crawler->filter('html')->text());
|
||||
$this->assertStringNotContainsString('Reapprove Test Topic #2', $crawler->filter('html')->text());
|
||||
|
||||
$this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
|
||||
'forum_posts_approved' => 1,
|
||||
|
@ -146,8 +146,8 @@ class phpbb_functional_visibility_reapprove_test extends phpbb_functional_test_c
|
|||
$this->add_lang('viewtopic');
|
||||
$this->add_lang('mcp');
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #1']}&sid={$this->sid}");
|
||||
$this->assertContains('Reapprove Test Topic #1', $crawler->filter('h2')->text());
|
||||
$this->assertContains('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text());
|
||||
$this->assertStringContainsString('Reapprove Test Topic #1', $crawler->filter('h2')->text());
|
||||
$this->assertStringContainsString('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text());
|
||||
|
||||
$form = $crawler->selectButton($this->lang('APPROVE'))->form();
|
||||
$crawler = self::submit($form);
|
||||
|
@ -167,11 +167,11 @@ class phpbb_functional_visibility_reapprove_test extends phpbb_functional_test_c
|
|||
|
||||
$link = $crawler->selectLink($this->lang('RETURN_PAGE', '', ''))->link();
|
||||
$link_url = $link->getUri();
|
||||
$this->assertContains('viewtopic.php?f=' . $this->data['forums']['Reapprove Test #1'] . '&t=' . $this->data['topics']['Reapprove Test Topic #1'], $link_url);
|
||||
$this->assertStringContainsString('viewtopic.php?f=' . $this->data['forums']['Reapprove Test #1'] . '&t=' . $this->data['topics']['Reapprove Test Topic #1'], $link_url);
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #1']}&sid={$this->sid}");
|
||||
$this->assertContains('Reapprove Test Topic #1', $crawler->filter('h2')->text());
|
||||
$this->assertContains('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text());
|
||||
$this->assertStringContainsString('Reapprove Test Topic #1', $crawler->filter('h2')->text());
|
||||
$this->assertStringContainsString('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text());
|
||||
}
|
||||
|
||||
public function test_approve_topic()
|
||||
|
@ -206,7 +206,7 @@ class phpbb_functional_visibility_reapprove_test extends phpbb_functional_test_c
|
|||
$this->add_lang('viewtopic');
|
||||
$this->add_lang('mcp');
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #2']}&sid={$this->sid}");
|
||||
$this->assertContains('Reapprove Test Topic #2', $crawler->filter('h2')->text());
|
||||
$this->assertStringContainsString('Reapprove Test Topic #2', $crawler->filter('h2')->text());
|
||||
|
||||
$form = $crawler->selectButton($this->lang('APPROVE'))->form();
|
||||
$crawler = self::submit($form);
|
||||
|
@ -226,10 +226,10 @@ class phpbb_functional_visibility_reapprove_test extends phpbb_functional_test_c
|
|||
|
||||
$link = $crawler->selectLink($this->lang('RETURN_PAGE', '', ''))->link();
|
||||
$link_url = $link->getUri();
|
||||
$this->assertContains('viewtopic.php?f=' . $this->data['forums']['Reapprove Test #1'], $link_url);
|
||||
$this->assertStringContainsString('viewtopic.php?f=' . $this->data['forums']['Reapprove Test #1'], $link_url);
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #2']}&sid={$this->sid}");
|
||||
$this->assertContains('Reapprove Test Topic #2', $crawler->filter('h2')->text());
|
||||
$this->assertStringContainsString('Reapprove Test Topic #2', $crawler->filter('h2')->text());
|
||||
}
|
||||
|
||||
public function test_edit_posts()
|
||||
|
@ -273,8 +273,8 @@ class phpbb_functional_visibility_reapprove_test extends phpbb_functional_test_c
|
|||
$this->submit_post($posting_url, 'EDIT_POST', $form_data, 'POST_EDITED_MOD');
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #1']}&sid={$this->sid}");
|
||||
$this->assertNotContains('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text());
|
||||
$this->assertNotContains('Post edited by testing framework', $crawler->filter('#page-body')->text());
|
||||
$this->assertStringNotContainsString('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text());
|
||||
$this->assertStringNotContainsString('Post edited by testing framework', $crawler->filter('#page-body')->text());
|
||||
|
||||
$this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
|
||||
'forum_posts_approved' => 2,
|
||||
|
@ -297,8 +297,8 @@ class phpbb_functional_visibility_reapprove_test extends phpbb_functional_test_c
|
|||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #2']}&sid={$this->sid}", array(), false);
|
||||
self::assert_response_html(404);
|
||||
$this->assertNotContains('Reapprove Test Topic #2', $crawler->filter('#page-body')->text());
|
||||
$this->assertNotContains('Post edited by testing framework', $crawler->filter('#page-body')->text());
|
||||
$this->assertStringNotContainsString('Reapprove Test Topic #2', $crawler->filter('#page-body')->text());
|
||||
$this->assertStringNotContainsString('Post edited by testing framework', $crawler->filter('#page-body')->text());
|
||||
|
||||
$this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
|
||||
'forum_posts_approved' => 1,
|
||||
|
@ -314,8 +314,8 @@ class phpbb_functional_visibility_reapprove_test extends phpbb_functional_test_c
|
|||
$this->login();
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #1']}&sid={$this->sid}");
|
||||
$this->assertContains('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text());
|
||||
$this->assertContains('Post edited by testing framework', $crawler->filter('#page-body')->text());
|
||||
$this->assertStringContainsString('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text());
|
||||
$this->assertStringContainsString('Post edited by testing framework', $crawler->filter('#page-body')->text());
|
||||
}
|
||||
|
||||
public function test_approve_post_again()
|
||||
|
|
|
@ -81,7 +81,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
|
|||
$post = $this->create_topic($this->data['forums']['Soft Delete #1'], 'Soft Delete Topic #1', 'This is a test topic posted by the testing framework.');
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
|
||||
|
||||
$this->assertContains('Soft Delete Topic #1', $crawler->filter('html')->text());
|
||||
$this->assertStringContainsString('Soft Delete Topic #1', $crawler->filter('html')->text());
|
||||
$this->data['topics']['Soft Delete Topic #1'] = (int) $post['topic_id'];
|
||||
$this->data['posts']['Soft Delete Topic #1'] = (int) $this->get_parameter_from_link($crawler->filter('.post')->selectLink($this->lang('POST', '', ''))->link()->getUri(), 'p');
|
||||
|
||||
|
@ -99,7 +99,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
|
|||
$post2 = $this->create_post($this->data['forums']['Soft Delete #1'], $post['topic_id'], 'Re: Soft Delete Topic #1-#2', 'This is a test post posted by the testing framework.');
|
||||
$crawler = self::request('GET', "viewtopic.php?p={$post2['post_id']}&sid={$this->sid}");
|
||||
|
||||
$this->assertContains('Re: Soft Delete Topic #1-#2', $crawler->filter('html')->text());
|
||||
$this->assertStringContainsString('Re: Soft Delete Topic #1-#2', $crawler->filter('html')->text());
|
||||
$this->data['posts']['Re: Soft Delete Topic #1-#2'] = (int) $post2['post_id'];
|
||||
|
||||
$this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
|
||||
|
@ -116,7 +116,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
|
|||
$post3 = $this->create_post($this->data['forums']['Soft Delete #1'], $post['topic_id'], 'Re: Soft Delete Topic #1-#3', 'This is another test post posted by the testing framework.');
|
||||
$crawler = self::request('GET', "viewtopic.php?p={$post3['post_id']}&sid={$this->sid}");
|
||||
|
||||
$this->assertContains('Re: Soft Delete Topic #1-#3', $crawler->filter('html')->text());
|
||||
$this->assertStringContainsString('Re: Soft Delete Topic #1-#3', $crawler->filter('html')->text());
|
||||
$this->data['posts']['Re: Soft Delete Topic #1-#3'] = (int) $post3['post_id'];
|
||||
|
||||
$this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
|
||||
|
@ -177,7 +177,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
|
|||
), 'after softdelete');
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
|
||||
$this->assertContains($this->lang('POST_DISPLAY', '', ''), $crawler->text());
|
||||
$this->assertStringContainsString($this->lang('POST_DISPLAY', '', ''), $crawler->text());
|
||||
}
|
||||
|
||||
public function test_softdelete_post_no_m_delete()
|
||||
|
@ -227,7 +227,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
|
|||
), 'after softdelete without m_delete');
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
|
||||
$this->assertContains($this->lang('POST_DISPLAY', '', ''), $crawler->text());
|
||||
$this->assertStringContainsString($this->lang('POST_DISPLAY', '', ''), $crawler->text());
|
||||
}
|
||||
|
||||
public function test_move_softdeleted_post()
|
||||
|
@ -278,8 +278,8 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
|
|||
$this->assertContainsLang('TOPIC_MOVED_SUCCESS', $crawler->text());
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
|
||||
$this->assertContains('Soft Delete #2', $crawler->filter('.navlinks')->text());
|
||||
$this->assertContains('Soft Delete Topic #1', $crawler->filter('h2')->text());
|
||||
$this->assertStringContainsString('Soft Delete #2', $crawler->filter('.navlinks')->text());
|
||||
$this->assertStringContainsString('Soft Delete Topic #1', $crawler->filter('h2')->text());
|
||||
|
||||
$this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
|
||||
'forum_posts_approved' => 0,
|
||||
|
@ -350,8 +350,8 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
|
|||
$this->assertContainsLang('TOPIC_DELETED_SUCCESS', $crawler->text());
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
|
||||
$this->assertContains('Soft Delete #2', $crawler->filter('.navlinks')->text());
|
||||
$this->assertContains('Soft Delete Topic #1', $crawler->filter('h2')->text());
|
||||
$this->assertStringContainsString('Soft Delete #2', $crawler->filter('.navlinks')->text());
|
||||
$this->assertStringContainsString('Soft Delete Topic #1', $crawler->filter('h2')->text());
|
||||
|
||||
$this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
|
||||
'forum_posts_approved' => 0,
|
||||
|
@ -422,8 +422,8 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
|
|||
$this->assertContainsLang('TOPIC_MOVED_SUCCESS', $crawler->text());
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
|
||||
$this->assertContains('Soft Delete #1', $crawler->filter('.navlinks')->text());
|
||||
$this->assertContains('Soft Delete Topic #1', $crawler->filter('h2')->text());
|
||||
$this->assertStringContainsString('Soft Delete #1', $crawler->filter('.navlinks')->text());
|
||||
$this->assertStringContainsString('Soft Delete Topic #1', $crawler->filter('h2')->text());
|
||||
|
||||
$this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
|
||||
'forum_posts_approved' => 0,
|
||||
|
@ -496,8 +496,8 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
|
|||
$this->assertContainsLang('POST_RESTORED_SUCCESS', $crawler->text());
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
|
||||
$this->assertContains('Soft Delete #1', $crawler->filter('.navlinks')->text());
|
||||
$this->assertContains('Soft Delete Topic #1', $crawler->filter('h2')->text());
|
||||
$this->assertStringContainsString('Soft Delete #1', $crawler->filter('.navlinks')->text());
|
||||
$this->assertStringContainsString('Soft Delete Topic #1', $crawler->filter('h2')->text());
|
||||
|
||||
$this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
|
||||
'forum_posts_approved' => 1,
|
||||
|
@ -575,8 +575,8 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
|
|||
$this->assertContainsLang('TOPIC_SPLIT_SUCCESS', $crawler->text());
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
|
||||
$this->assertContains('Soft Delete Topic #1', $crawler->filter('h2')->text());
|
||||
$this->assertNotContains('Re: Soft Delete Topic #1-#2', $crawler->text());
|
||||
$this->assertStringContainsString('Soft Delete Topic #1', $crawler->filter('h2')->text());
|
||||
$this->assertStringNotContainsString('Re: Soft Delete Topic #1-#2', $crawler->text());
|
||||
|
||||
$this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
|
||||
'forum_posts_approved' => 1,
|
||||
|
@ -601,7 +601,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
|
|||
// Assert new topic title is indexed as well
|
||||
$this->add_lang('search');
|
||||
self::request('GET', "search.php?keywords=bang&sid={$this->sid}");
|
||||
$this->assertContains(sprintf($this->lang['FOUND_SEARCH_MATCHES'][1], 1), self::get_content());
|
||||
$this->assertStringContainsString(sprintf($this->lang['FOUND_SEARCH_MATCHES'][1], 1), self::get_content());
|
||||
}
|
||||
|
||||
public function test_move_topic_back()
|
||||
|
@ -689,7 +689,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
|
|||
$this->assertContainsLang('POSTS_MERGED_SUCCESS', $crawler->text());
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
|
||||
$this->assertContains('Soft Delete Topic #1', $crawler->filter('h2')->text());
|
||||
$this->assertStringContainsString('Soft Delete Topic #1', $crawler->filter('h2')->text());
|
||||
$this->assertContainsLang('POST_DELETED_ACTION', $crawler->filter('body')->text());
|
||||
$this->assertContainsLang('BOOKMARK_TOPIC_REMOVE', $crawler->filter('body')->text());
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ class phpbb_functional_visibility_unapproved_test extends phpbb_functional_test_
|
|||
$post = $this->create_topic($this->data['forums']['Unapproved Posts Test #1'], 'Unapproved Posts Test Topic #1', 'This is a test topic posted by the testing framework.');
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
|
||||
|
||||
$this->assertContains('Unapproved Posts Test Topic #1', $crawler->filter('h2')->text());
|
||||
$this->assertStringContainsString('Unapproved Posts Test Topic #1', $crawler->filter('h2')->text());
|
||||
$this->data['topics']['Unapproved Posts Test Topic #1'] = (int) $post['topic_id'];
|
||||
$this->data['posts']['Unapproved Posts Test Topic #1'] = (int) $this->get_parameter_from_link($crawler->filter('.post')->selectLink($this->lang('POST', '', ''))->link()->getUri(), 'p');
|
||||
|
||||
|
@ -83,7 +83,7 @@ class phpbb_functional_visibility_unapproved_test extends phpbb_functional_test_
|
|||
$post2 = $this->create_post($this->data['forums']['Unapproved Posts Test #1'], $post['topic_id'], 'Re: Unapproved Posts Test Topic #1-#2', 'This is a test post posted by the testing framework.', [], 'POST_STORED_MOD');
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Unapproved Posts Test Topic #1']}&sid={$this->sid}");
|
||||
$this->assertNotContains('Re: Unapproved Posts Test Topic #1-#2', $crawler->filter('#page-body')->text());
|
||||
$this->assertStringNotContainsString('Re: Unapproved Posts Test Topic #1-#2', $crawler->filter('#page-body')->text());
|
||||
|
||||
$this->assert_forum_details($this->data['forums']['Unapproved Posts Test #1'], [
|
||||
'forum_posts_approved' => 1,
|
||||
|
@ -99,7 +99,7 @@ class phpbb_functional_visibility_unapproved_test extends phpbb_functional_test_
|
|||
$post = $this->create_topic($this->data['forums']['Unapproved Posts Test #1'], 'Unapproved Posts Test Topic #2', 'This is a test topic posted by the testing framework.', [], 'POST_STORED_MOD');
|
||||
$crawler = self::request('GET', "viewforum.php?f={$this->data['forums']['Unapproved Posts Test #1']}&sid={$this->sid}");
|
||||
|
||||
$this->assertNotContains('Unapproved Posts Test Topic #2', $crawler->filter('html')->text());
|
||||
$this->assertStringNotContainsString('Unapproved Posts Test Topic #2', $crawler->filter('html')->text());
|
||||
|
||||
$this->assert_forum_details($this->data['forums']['Unapproved Posts Test #1'], [
|
||||
'forum_posts_approved' => 1,
|
||||
|
@ -149,13 +149,13 @@ class phpbb_functional_visibility_unapproved_test extends phpbb_functional_test_
|
|||
|
||||
// should be able to see topic 1 but not unapproved post
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Unapproved Posts Test Topic #1']}&sid={$this->sid}");
|
||||
$this->assertContains('Unapproved Posts Test Topic #1', $crawler->filter('h2')->text());
|
||||
$this->assertNotContains('Re: Unapproved Posts Test Topic #1-#2', $crawler->filter('#page-body')->text());
|
||||
$this->assertNotContains('This post is not visible to other users until it has been approved', $crawler->filter('#page-body')->text());
|
||||
$this->assertStringContainsString('Unapproved Posts Test Topic #1', $crawler->filter('h2')->text());
|
||||
$this->assertStringNotContainsString('Re: Unapproved Posts Test Topic #1-#2', $crawler->filter('#page-body')->text());
|
||||
$this->assertStringNotContainsString('This post is not visible to other users until it has been approved', $crawler->filter('#page-body')->text());
|
||||
|
||||
// should not be able to see topic 2
|
||||
$crawler = self::request('GET', "viewforum.php?f={$this->data['forums']['Unapproved Posts Test #1']}&sid={$this->sid}");
|
||||
$this->assertNotContains('Unapproved Posts Test Topic #2', $crawler->filter('html')->text());
|
||||
$this->assertStringNotContainsString('Unapproved Posts Test Topic #2', $crawler->filter('html')->text());
|
||||
$this->logout();
|
||||
|
||||
// another user
|
||||
|
@ -166,13 +166,13 @@ class phpbb_functional_visibility_unapproved_test extends phpbb_functional_test_
|
|||
|
||||
// should be able to see topic 1 but not unapproved post
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Unapproved Posts Test Topic #1']}&sid={$this->sid}");
|
||||
$this->assertContains('Unapproved Posts Test Topic #1', $crawler->filter('h2')->text());
|
||||
$this->assertNotContains('Re: Unapproved Posts Test Topic #1-#2', $crawler->filter('#page-body')->text());
|
||||
$this->assertNotContains('This post is not visible to other users until it has been approved', $crawler->filter('#page-body')->text());
|
||||
$this->assertStringContainsString('Unapproved Posts Test Topic #1', $crawler->filter('h2')->text());
|
||||
$this->assertStringNotContainsString('Re: Unapproved Posts Test Topic #1-#2', $crawler->filter('#page-body')->text());
|
||||
$this->assertStringNotContainsString('This post is not visible to other users until it has been approved', $crawler->filter('#page-body')->text());
|
||||
|
||||
// should not be able to see topic 2
|
||||
$crawler = self::request('GET', "viewforum.php?f={$this->data['forums']['Unapproved Posts Test #1']}&sid={$this->sid}");
|
||||
$this->assertNotContains('Unapproved Posts Test Topic #2', $crawler->filter('html')->text());
|
||||
$this->assertStringNotContainsString('Unapproved Posts Test Topic #2', $crawler->filter('html')->text());
|
||||
}
|
||||
|
||||
public function test_view_unapproved_post_enabled()
|
||||
|
@ -212,18 +212,18 @@ class phpbb_functional_visibility_unapproved_test extends phpbb_functional_test_
|
|||
|
||||
// should be able to see topic 1 and unapproved post
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Unapproved Posts Test Topic #1']}&sid={$this->sid}");
|
||||
$this->assertContains('Unapproved Posts Test Topic #1', $crawler->filter('h2')->text());
|
||||
$this->assertContains('Re: Unapproved Posts Test Topic #1-#2', $crawler->filter('#page-body')->text());
|
||||
$this->assertContains('This post is not visible to other users until it has been approved', $crawler->filter('#page-body')->text());
|
||||
$this->assertStringContainsString('Unapproved Posts Test Topic #1', $crawler->filter('h2')->text());
|
||||
$this->assertStringContainsString('Re: Unapproved Posts Test Topic #1-#2', $crawler->filter('#page-body')->text());
|
||||
$this->assertStringContainsString('This post is not visible to other users until it has been approved', $crawler->filter('#page-body')->text());
|
||||
|
||||
// should be able to see topic 2
|
||||
$crawler = self::request('GET', "viewforum.php?f={$this->data['forums']['Unapproved Posts Test #1']}&sid={$this->sid}");
|
||||
$this->assertContains('Unapproved Posts Test Topic #2', $crawler->filter('html')->text());
|
||||
$this->assertStringContainsString('Unapproved Posts Test Topic #2', $crawler->filter('html')->text());
|
||||
|
||||
// should be able to see post in topic 2
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Unapproved Posts Test Topic #2']}&sid={$this->sid}");
|
||||
$this->assertContains('Unapproved Posts Test Topic #2', $crawler->filter('#page-body')->text());
|
||||
$this->assertContains('This post is not visible to other users until it has been approved', $crawler->filter('#page-body')->text());
|
||||
$this->assertStringContainsString('Unapproved Posts Test Topic #2', $crawler->filter('#page-body')->text());
|
||||
$this->assertStringContainsString('This post is not visible to other users until it has been approved', $crawler->filter('#page-body')->text());
|
||||
$this->logout();
|
||||
|
||||
// another user
|
||||
|
@ -235,13 +235,13 @@ class phpbb_functional_visibility_unapproved_test extends phpbb_functional_test_
|
|||
|
||||
// should be able to see topic 1 but not unapproved post
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Unapproved Posts Test Topic #1']}&sid={$this->sid}");
|
||||
$this->assertContains('Unapproved Posts Test Topic #1', $crawler->filter('h2')->text());
|
||||
$this->assertNotContains('Re: Unapproved Posts Test Topic #1-#2', $crawler->filter('#page-body')->text());
|
||||
$this->assertNotContains('This post is not visible to other users until it has been approved', $crawler->filter('#page-body')->text());
|
||||
$this->assertStringContainsString('Unapproved Posts Test Topic #1', $crawler->filter('h2')->text());
|
||||
$this->assertStringNotContainsString('Re: Unapproved Posts Test Topic #1-#2', $crawler->filter('#page-body')->text());
|
||||
$this->assertStringNotContainsString('This post is not visible to other users until it has been approved', $crawler->filter('#page-body')->text());
|
||||
|
||||
// should not be able to see topic 2
|
||||
$crawler = self::request('GET', "viewforum.php?f={$this->data['forums']['Unapproved Posts Test #1']}&sid={$this->sid}");
|
||||
$this->assertNotContains('Unapproved Posts Test Topic #2', $crawler->filter('html')->text());
|
||||
$this->assertStringNotContainsString('Unapproved Posts Test Topic #2', $crawler->filter('html')->text());
|
||||
$this->logout();
|
||||
}
|
||||
|
||||
|
|
|
@ -19,12 +19,12 @@ class phpbb_functional_visit_installer_test extends phpbb_functional_test_case
|
|||
public function test_visit_installer()
|
||||
{
|
||||
self::request('GET', 'install/', [], false);
|
||||
$this->assertContains('<meta http-equiv="refresh" content="0; url=./app.php" />', $this->get_content());
|
||||
$this->assertStringContainsString('<meta http-equiv="refresh" content="0; url=./app.php" />', $this->get_content());
|
||||
|
||||
self::request('GET', 'install/index.html', [], false);
|
||||
$this->assertContains('<meta http-equiv="refresh" content="0; url=./app.php" />', $this->get_content());
|
||||
$this->assertStringContainsString('<meta http-equiv="refresh" content="0; url=./app.php" />', $this->get_content());
|
||||
|
||||
self::request('GET', 'install/app.php');
|
||||
$this->assertContains('installation system', $this->get_content());
|
||||
$this->assertStringContainsString('installation system', $this->get_content());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ class phpbb_functions_get_remote_file extends phpbb_test_case
|
|||
'Failed asserting that the second line of the version file is a valid URL.'
|
||||
);
|
||||
|
||||
$this->assertContains('http', $lines[1]);
|
||||
$this->assertContains('phpbb.com', $lines[1], '', true);
|
||||
$this->assertStringContainsString('http', $lines[1]);
|
||||
$this->assertStringContainsString('phpbb.com', $lines[1], '', true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ class phpbb_functions_user_delete_test extends phpbb_database_test_case
|
|||
$lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx);
|
||||
$lang = new \phpbb\language\language($lang_loader);
|
||||
$user = new \phpbb\user($lang, '\phpbb\datetime');
|
||||
$user->data['user_id'] = 2;
|
||||
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
|
||||
$phpbb_container = new phpbb_mock_container_builder();
|
||||
$config = new \phpbb\config\config(array(
|
||||
|
|
|
@ -30,7 +30,7 @@ class phpbb_functions_validate_num_test extends phpbb_test_case
|
|||
$this->helper->assert_valid_data(array(
|
||||
'empty' => array(
|
||||
array(),
|
||||
'',
|
||||
null, // '' < 0 is true since PHP 8.0, hence use null instead of '' (empty string)
|
||||
array('num'),
|
||||
),
|
||||
'zero' => array(
|
||||
|
@ -54,7 +54,7 @@ class phpbb_functions_validate_num_test extends phpbb_test_case
|
|||
array('num', false, 2, 3),
|
||||
),
|
||||
'string' => array(
|
||||
array(),
|
||||
version_compare(PHP_VERSION, '7.5', '<=') ? [] : ['TOO_LARGE'], // See https://wiki.php.net/rfc/string_to_number_comparison
|
||||
'foobar',
|
||||
array('num'),
|
||||
),
|
||||
|
|
|
@ -38,6 +38,7 @@ class phpbb_functions_validate_user_email_test extends phpbb_database_test_case
|
|||
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
|
||||
$language = new phpbb\language\language(new phpbb\language\language_file_loader($phpbb_root_path, $phpEx));
|
||||
$this->user = new phpbb\user($language, '\phpbb\datetime');
|
||||
$this->user->data['user_email'] = '';
|
||||
$this->helper = new phpbb_functions_validate_data_helper($this);
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ class phpbb_functions_content_phpbb_format_quote_test extends phpbb_test_case
|
|||
$lang_file_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx);
|
||||
$this->lang = new \phpbb\language\language($lang_file_loader);
|
||||
$user = new \phpbb\user($this->lang, '\phpbb\datetime');
|
||||
$user->data['user_options'] = 230271;
|
||||
$cache = new phpbb_mock_cache();
|
||||
|
||||
parent::setUp();
|
||||
|
|
|
@ -54,11 +54,9 @@ class phpbb_functions_privmsgs_get_max_setting_from_group_test extends phpbb_dat
|
|||
$this->assertEquals($expected, phpbb_get_max_setting_from_group($this->db, $user_id, $setting));
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException InvalidArgumentException
|
||||
*/
|
||||
public function test_get_max_setting_from_group_throws()
|
||||
{
|
||||
$this->expectException('InvalidArgumentException');
|
||||
phpbb_get_max_setting_from_group($this->db, ANONYMOUS, 'not_a_setting');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
|
|||
|
||||
class phpbb_functions_user_whois_test extends phpbb_test_case
|
||||
{
|
||||
public function setUp()
|
||||
public function setUp(): void
|
||||
{
|
||||
global $config, $phpbb_dispatcher, $user, $request, $symfony_request, $phpbb_root_path, $phpEx;
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ class phpbb_group_helper_test_case extends phpbb_test_case
|
|||
$this->group_helper = new \phpbb\group\helper($auth, $cache_service, $config, $lang, $phpbb_dispatcher, $path_helper, $user);
|
||||
}
|
||||
|
||||
protected function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->setup_engine();
|
||||
}
|
||||
|
|
|
@ -64,44 +64,33 @@ class phpbb_help_manager_test extends phpbb_test_case
|
|||
*/
|
||||
public function test_add_block($block_name, $switch, $questions, $switch_expected)
|
||||
{
|
||||
$this->language->expects($this->at(0))
|
||||
->method('lang')
|
||||
->with($block_name)
|
||||
->willReturn(strtoupper($block_name));
|
||||
$lang_call_count = 1;
|
||||
$question_ary = $question_ary_upper = $template_call_args = [];
|
||||
foreach ($questions as $question => $answer)
|
||||
{
|
||||
$this->language->expects($this->at($lang_call_count))
|
||||
->method('lang')
|
||||
->with($question)
|
||||
->willReturn(strtoupper($question));
|
||||
$lang_call_count++;
|
||||
|
||||
$this->language->expects($this->at($lang_call_count))
|
||||
->method('lang')
|
||||
->with($answer)
|
||||
->willReturn(strtoupper($answer));
|
||||
$lang_call_count++;
|
||||
}
|
||||
|
||||
$this->template->expects($this->at(0))
|
||||
->method('assign_block_vars')
|
||||
->with('faq_block', array(
|
||||
'BLOCK_TITLE' => strtoupper($block_name),
|
||||
'SWITCH_COLUMN' => $switch_expected,
|
||||
));
|
||||
$template_call_count = 1;
|
||||
foreach ($questions as $question => $answer)
|
||||
{
|
||||
$this->template->expects($this->at($template_call_count))
|
||||
->method('assign_block_vars')
|
||||
->with('faq_block.faq_row', array(
|
||||
$question_ary = array_merge($question_ary, [[$question], [$answer]]);
|
||||
$question_ary_upper = array_merge($question_ary_upper, [strtoupper($question), strtoupper($answer)]);
|
||||
$template_call_args = array_merge($template_call_args, [['faq_block.faq_row', [
|
||||
'FAQ_QUESTION' => strtoupper($question),
|
||||
'FAQ_ANSWER' => strtoupper($answer),
|
||||
));
|
||||
$template_call_count++;
|
||||
]
|
||||
]]);
|
||||
}
|
||||
|
||||
$this->language->expects($this->exactly(count($questions)*2 + 1))
|
||||
->method('lang')
|
||||
->withConsecutive([$block_name], ...$question_ary)
|
||||
->will($this->onConsecutiveCalls(strtoupper($block_name), ...$question_ary_upper));
|
||||
|
||||
$this->template->expects($this->exactly(count($questions) + 1))
|
||||
->method('assign_block_vars')
|
||||
->withConsecutive(
|
||||
['faq_block', [
|
||||
'BLOCK_TITLE' => strtoupper($block_name),
|
||||
'SWITCH_COLUMN' => $switch_expected,
|
||||
]],
|
||||
...$template_call_args
|
||||
);
|
||||
|
||||
$this->manager->add_block($block_name, $switch, $questions);
|
||||
|
||||
$this->assertEquals($switch_expected, $this->manager->switched_column());
|
||||
|
@ -110,8 +99,8 @@ class phpbb_help_manager_test extends phpbb_test_case
|
|||
public function add_question_data()
|
||||
{
|
||||
return array(
|
||||
array('abc', false, false),
|
||||
array('def', true, true),
|
||||
array('question1', 'answer1'),
|
||||
array('question2', 'answer2'),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -123,14 +112,13 @@ class phpbb_help_manager_test extends phpbb_test_case
|
|||
*/
|
||||
public function test_add_question($question, $answer)
|
||||
{
|
||||
$this->language->expects($this->at(0))
|
||||
$this->language->expects($this->exactly(2))
|
||||
->method('lang')
|
||||
->with($question)
|
||||
->willReturn(strtoupper($question));
|
||||
$this->language->expects($this->at(1))
|
||||
->method('lang')
|
||||
->with($answer)
|
||||
->willReturn(strtoupper($answer));
|
||||
->withConsecutive(
|
||||
[$question],
|
||||
[$answer]
|
||||
)
|
||||
->will($this->onConsecutiveCalls(strtoupper($question), strtoupper($answer)));
|
||||
|
||||
$this->template->expects($this->once())
|
||||
->method('assign_block_vars')
|
||||
|
@ -144,41 +132,33 @@ class phpbb_help_manager_test extends phpbb_test_case
|
|||
|
||||
public function test_add_block_double_switch()
|
||||
{
|
||||
$block_name = 'abc';
|
||||
$switch_expected = true;
|
||||
$block_name = ['abc', 'def'];
|
||||
$switch_expected = [true, false];
|
||||
|
||||
$this->language->expects($this->at(0))
|
||||
$this->language->expects($this->exactly(2))
|
||||
->method('lang')
|
||||
->with($block_name)
|
||||
->willReturn(strtoupper($block_name));
|
||||
->withConsecutive([$block_name[0]], [$block_name[1]])
|
||||
->will($this->onConsecutiveCalls(strtoupper($block_name[0]), strtoupper($block_name[1])));
|
||||
|
||||
$this->template->expects($this->at(0))
|
||||
$this->template->expects($this->exactly(2))
|
||||
->method('assign_block_vars')
|
||||
->with('faq_block', array(
|
||||
'BLOCK_TITLE' => strtoupper($block_name),
|
||||
'SWITCH_COLUMN' => $switch_expected,
|
||||
));
|
||||
->withConsecutive(
|
||||
['faq_block', [
|
||||
'BLOCK_TITLE' => strtoupper($block_name[0]),
|
||||
'SWITCH_COLUMN' => $switch_expected[0],
|
||||
]],
|
||||
['faq_block', [
|
||||
'BLOCK_TITLE' => strtoupper($block_name[1]),
|
||||
'SWITCH_COLUMN' => $switch_expected[1],
|
||||
]]
|
||||
|
||||
);
|
||||
|
||||
$this->manager->add_block($block_name, true);
|
||||
$this->manager->add_block($block_name[0], true);
|
||||
$this->assertTrue($this->manager->switched_column());
|
||||
|
||||
// Add a second block with switch
|
||||
$block_name = 'def';
|
||||
$switch_expected = false;
|
||||
|
||||
$this->language->expects($this->at(0))
|
||||
->method('lang')
|
||||
->with($block_name)
|
||||
->willReturn(strtoupper($block_name));
|
||||
|
||||
$this->template->expects($this->at(0))
|
||||
->method('assign_block_vars')
|
||||
->with('faq_block', array(
|
||||
'BLOCK_TITLE' => strtoupper($block_name),
|
||||
'SWITCH_COLUMN' => $switch_expected,
|
||||
));
|
||||
|
||||
$this->manager->add_block($block_name, true);
|
||||
$this->manager->add_block($block_name[1], true);
|
||||
$this->assertTrue($this->manager->switched_column());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
*
|
||||
*/
|
||||
|
||||
class phpbb_lint_test extends phpbb_test_case
|
||||
class lint_test extends phpbb_test_case
|
||||
{
|
||||
static protected $php_binary;
|
||||
|
||||
static public function setUpBeforeClass()
|
||||
static public function setUpBeforeClass(): void
|
||||
{
|
||||
// Try to use PHP_BINARY constant if available so lint tests are run
|
||||
// using the same php binary as phpunit. If not available (pre PHP
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
class migrations_check_config_added_test extends phpbb_test_case
|
||||
{
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
global $phpbb_root_path;
|
||||
|
||||
|
@ -36,6 +36,10 @@ class migrations_check_config_added_test extends phpbb_test_case
|
|||
$this->phpbb_root_path = $phpbb_root_path;
|
||||
$this->php_ext = $phpEx;
|
||||
|
||||
$tools = [
|
||||
new \phpbb\db\migration\tool\config($this->config),
|
||||
];
|
||||
|
||||
$this->container = new phpbb_mock_container_builder();
|
||||
|
||||
$this->migrator = new \phpbb\db\migrator(
|
||||
|
@ -48,7 +52,7 @@ class migrations_check_config_added_test extends phpbb_test_case
|
|||
$this->php_ext,
|
||||
$this->table_prefix,
|
||||
[],
|
||||
[],
|
||||
$tools,
|
||||
new \phpbb\db\migration\helper()
|
||||
);
|
||||
$this->container->set('migrator', $this->migrator);
|
||||
|
|
|
@ -46,11 +46,9 @@ class schema_generator_test extends phpbb_test_case
|
|||
return $this->generator;
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \UnexpectedValueException
|
||||
*/
|
||||
public function test_check_dependencies_fail()
|
||||
{
|
||||
$this->expectException(\UnexpectedValueException::class);
|
||||
$this->get_schema_generator(array('\phpbb\db\migration\data\v310\forgot_password'));
|
||||
|
||||
$this->generator->get_schema();
|
||||
|
|
|
@ -123,11 +123,10 @@ class guesser_test extends \phpbb_test_case
|
|||
|
||||
/**
|
||||
* @dataProvider data_incorrect_guessers
|
||||
*
|
||||
* @expectedException \LogicException
|
||||
*/
|
||||
public function test_incorrect_guesser($guessers)
|
||||
{
|
||||
$this->expectException(\LogicException::class);
|
||||
$guesser = new \phpbb\mimetype\guesser($guessers);
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ class phpbb_mock_container_builder implements ContainerInterface
|
|||
if ($this->has($id))
|
||||
{
|
||||
$service = $this->services[$id];
|
||||
if (is_array($service) && is_callable($service[0]))
|
||||
if (is_array($service) && isset($service[0]) && is_callable($service[0]))
|
||||
{
|
||||
return call_user_func_array($service[0], $service[1]);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ class phpbb_network_ftp_fsock_pasv_epsv_test extends phpbb_test_case
|
|||
{
|
||||
static protected $ipv4;
|
||||
|
||||
static public function setUpBeforeClass()
|
||||
static public function setUpBeforeClass(): void
|
||||
{
|
||||
$hostname = 'ftp.debian.org.';
|
||||
self::$ipv4 = gethostbyname($hostname);
|
||||
|
@ -55,7 +55,7 @@ class phpbb_network_ftp_fsock_pasv_epsv_test extends phpbb_test_case
|
|||
{
|
||||
$this->markTestSkipped("Failed to connect to $hostname: $result");
|
||||
}
|
||||
$this->assertContains('debian', $o->_ls());
|
||||
$this->assertStringContainsString('debian', $o->_ls());
|
||||
$o->_close();
|
||||
}
|
||||
|
||||
|
|
|
@ -74,6 +74,8 @@ abstract class phpbb_tests_notification_base extends phpbb_database_test_case
|
|||
$lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx);
|
||||
$lang = new \phpbb\language\language($lang_loader);
|
||||
$user = new \phpbb\user($lang, '\phpbb\datetime');
|
||||
$user->data['user_id'] = 0;
|
||||
$user->data['user_type'] = USER_NORMAL;
|
||||
$this->user = $user;
|
||||
$this->user_loader = new \phpbb\user_loader($this->db, $phpbb_root_path, $phpEx, 'phpbb_users');
|
||||
$auth = $this->auth = new phpbb_mock_notifications_auth();
|
||||
|
|
|
@ -38,9 +38,6 @@ services:
|
|||
groupposition.teampage:
|
||||
synthetic: true
|
||||
|
||||
groupposition.teampage:
|
||||
synthetic: true
|
||||
|
||||
text_formatter.s9e.factory:
|
||||
synthetic: true
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ class notification_method_email_test extends phpbb_tests_notification_base
|
|||
];
|
||||
}
|
||||
|
||||
protected function setUp() : void
|
||||
protected function setUp(): void
|
||||
{
|
||||
phpbb_database_test_case::setUp();
|
||||
|
||||
|
@ -249,7 +249,16 @@ class notification_method_email_test extends phpbb_tests_notification_base
|
|||
*/
|
||||
public function test_notification_email($notification_type, $post_data, $expected_users)
|
||||
{
|
||||
$post_data = array_merge(['post_time' => 1349413322], $post_data);
|
||||
$post_data = array_merge([
|
||||
'post_time' => 1349413322,
|
||||
'poster_id' => 1,
|
||||
'topic_title' => '',
|
||||
'post_subject' => '',
|
||||
'post_username' => '',
|
||||
'forum_name' => '',
|
||||
],
|
||||
|
||||
$post_data);
|
||||
$notification_options = [
|
||||
'item_id' => $post_data['post_id'],
|
||||
'item_parent_id' => $post_data['topic_id'],
|
||||
|
|
|
@ -160,6 +160,8 @@ class phpbb_notification_test extends phpbb_tests_notification_base
|
|||
'post_subject' => 'Re: test-title',
|
||||
'forum_id' => 2,
|
||||
'forum_name' => 'Your first forum',
|
||||
'post_username' => '',
|
||||
'post_text' => 'test text',
|
||||
));
|
||||
|
||||
$this->db->sql_query('INSERT INTO ' . BOOKMARKS_TABLE . ' ' . $this->db->sql_build_array('INSERT', array(
|
||||
|
@ -176,6 +178,8 @@ class phpbb_notification_test extends phpbb_tests_notification_base
|
|||
'post_subject' => 'Re: test-title',
|
||||
'forum_id' => 2,
|
||||
'forum_name' => 'Your first forum',
|
||||
'post_username' => '',
|
||||
'post_text' => 'test text',
|
||||
));
|
||||
|
||||
$this->notifications->delete_subscription('test');
|
||||
|
@ -267,6 +271,9 @@ class phpbb_notification_test extends phpbb_tests_notification_base
|
|||
'post_subject' => 'Re: test-title2', // change post_subject
|
||||
'forum_id' => 3, // change forum_id
|
||||
'forum_name' => 'Your second forum', // change forum_name
|
||||
'post_username' => '',
|
||||
'post_text' => 'test text2',
|
||||
'post_time' => 1349413325,
|
||||
));
|
||||
|
||||
$this->assert_notifications(
|
||||
|
|
|
@ -39,6 +39,9 @@ abstract class phpbb_notification_submit_post_base extends phpbb_database_test_c
|
|||
'bbcode_bitfield' => '',
|
||||
'bbcode_uid' => '',
|
||||
'post_edit_locked' => false,
|
||||
'notify_set' => 0,
|
||||
'notify' => false,
|
||||
'forum_name' => 'Test forum name',
|
||||
//'force_approved_state' => 1,
|
||||
);
|
||||
|
||||
|
@ -102,6 +105,7 @@ abstract class phpbb_notification_submit_post_base extends phpbb_database_test_c
|
|||
'username' => 'user-name',
|
||||
'is_registered' => true,
|
||||
'user_colour' => '',
|
||||
'user_lastmark' => 0,
|
||||
);
|
||||
|
||||
// Request
|
||||
|
|
|
@ -135,9 +135,10 @@ class phpbb_notification_submit_post_type_topic_test extends phpbb_notification_
|
|||
$this->db->sql_freeresult($result);
|
||||
|
||||
$result = $this->db->sql_query(
|
||||
'SELECT *
|
||||
FROM ' . POSTS_TABLE . '
|
||||
WHERE post_id = ' . $reply_id);
|
||||
'SELECT p.*, t.topic_posts_approved, t.topic_posts_unapproved, t.topic_posts_softdeleted, t.topic_first_post_id, t.topic_last_post_id
|
||||
FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t
|
||||
WHERE p.topic_id = t.topic_id
|
||||
AND p.post_id = ' . $reply_id);
|
||||
$reply_edit_data = array_merge($this->post_data, $this->db->sql_fetchrow($result), array(
|
||||
'force_approved_state' => false,
|
||||
'post_edit_reason' => 'PHPBB3-12370',
|
||||
|
|
|
@ -51,7 +51,10 @@ class phpbb_notification_user_list_trim_test extends phpbb_database_test_case
|
|||
$lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx);
|
||||
$lang = new \phpbb\language\language($lang_loader);
|
||||
$user = new \phpbb\user($lang, '\phpbb\datetime');
|
||||
$user->data = array('user_lang' => 'en');
|
||||
$user->data = [
|
||||
'user_id' => 1,
|
||||
'user_lang' => 'en',
|
||||
];
|
||||
$lang->add_lang('common');
|
||||
|
||||
$user_loader = new phpbb\user_loader($db, $phpbb_root_path, $phpEx, USERS_TABLE);
|
||||
|
|
|
@ -63,6 +63,8 @@ class manager_test extends phpbb_database_test_case
|
|||
$language = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx));
|
||||
$collection = new \phpbb\di\service_collection($container);
|
||||
$user = new \phpbb\user($language, '\phpbb\datetime');
|
||||
$user->data['user_id'] = 2;
|
||||
$user->ip = '';
|
||||
|
||||
$this->log = new \phpbb\log\log($this->db, $user, $auth, $dispatcher, $phpbb_root_path, 'adm/', $phpEx, $table_prefix . 'log');
|
||||
|
||||
|
|
|
@ -65,8 +65,10 @@ class phpbb_profilefield_type_bool_test extends phpbb_test_case
|
|||
'lang_id' => 1,
|
||||
'lang_name' => 'field',
|
||||
'field_required' => false,
|
||||
'field_default_value' => 1,
|
||||
'field_length' => 1,
|
||||
'field_default_value' => 1,
|
||||
'field_length' => 1,
|
||||
'field_show_novalue' => null,
|
||||
'field_novalue' => null,
|
||||
);
|
||||
|
||||
$this->options = array(
|
||||
|
|
|
@ -55,6 +55,8 @@ class phpbb_profilefield_type_date_test extends phpbb_test_case
|
|||
'lang_id' => 1,
|
||||
'lang_name' => 'field',
|
||||
'field_required' => false,
|
||||
'field_show_novalue' => null,
|
||||
'field_novalue' => null,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -66,6 +66,7 @@ class phpbb_profilefield_type_dropdown_test extends phpbb_test_case
|
|||
'field_required' => false,
|
||||
'field_validation' => '.*',
|
||||
'field_novalue' => 0,
|
||||
'field_show_novalue' => null,
|
||||
);
|
||||
|
||||
$this->dropdown_options = array(
|
||||
|
@ -153,7 +154,7 @@ class phpbb_profilefield_type_dropdown_test extends phpbb_test_case
|
|||
'Field should output nothing for empty value',
|
||||
),
|
||||
array(
|
||||
'',
|
||||
null, // Since PHP 8, '' == 0 returns false, hence use null instead of '' (empty string)
|
||||
array('field_show_novalue' => false),
|
||||
null,
|
||||
'Field should simply output null for empty value',
|
||||
|
@ -184,7 +185,7 @@ class phpbb_profilefield_type_dropdown_test extends phpbb_test_case
|
|||
'Field should return the correct raw value',
|
||||
),
|
||||
array(
|
||||
'',
|
||||
null, // Since PHP 8, '' == 0 returns false, hence use null instead of '' (empty string)
|
||||
array('field_show_novalue' => false),
|
||||
null,
|
||||
'Field should null for empty value without show_novalue',
|
||||
|
|
|
@ -44,6 +44,10 @@ class phpbb_profilefield_type_int_test extends phpbb_test_case
|
|||
'lang_id' => 1,
|
||||
'lang_name' => 'field',
|
||||
'field_required' => false,
|
||||
'field_show_novalue' => null,
|
||||
'field_novalue' => null,
|
||||
'field_minlen' => null,
|
||||
'field_maxlen' => null,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -49,6 +49,10 @@ class phpbb_profilefield_type_string_test extends phpbb_test_case
|
|||
'lang_name' => 'field',
|
||||
'field_required' => false,
|
||||
'field_validation' => '.*',
|
||||
'field_show_novalue' => null,
|
||||
'field_novalue' => null,
|
||||
'field_minlen' => null,
|
||||
'field_maxlen' => null,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -52,6 +52,10 @@ class phpbb_profilefield_type_url_test extends phpbb_test_case
|
|||
'lang_id' => 1,
|
||||
'lang_name' => 'field',
|
||||
'field_required' => false,
|
||||
'field_show_novalue' => null,
|
||||
'field_novalue' => null,
|
||||
'field_minlen' => null,
|
||||
'field_maxlen' => null,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue