mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/16549] Move from assert[Not]Contains to assertString[Not]ContainsString
PHPBB3-16549
This commit is contained in:
parent
16d8698e1b
commit
58ea656fd8
49 changed files with 291 additions and 280 deletions
|
@ -162,7 +162,7 @@ class phpbb_console_command_config_test extends phpbb_test_case
|
||||||
'--no-newline' => false,
|
'--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()
|
public function test_increment_dynamic()
|
||||||
|
@ -178,7 +178,7 @@ class phpbb_console_command_config_test extends phpbb_test_case
|
||||||
'--dynamic' => true,
|
'--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']);
|
$this->assertSame(2, $this->config['test_key']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,7 +195,7 @@ class phpbb_console_command_config_test extends phpbb_test_case
|
||||||
'--dynamic' => false,
|
'--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']);
|
$this->assertSame(2, $this->config['test_key']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@ class phpbb_console_command_config_test extends phpbb_test_case
|
||||||
'--dynamic' => true,
|
'--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']);
|
$this->assertSame(2, $this->config['test_key']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,7 +226,7 @@ class phpbb_console_command_config_test extends phpbb_test_case
|
||||||
'key' => 'test_key',
|
'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);
|
$this->assertEmpty($this->config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,7 +240,7 @@ class phpbb_console_command_config_test extends phpbb_test_case
|
||||||
'key' => 'wrong_key',
|
'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);
|
$this->assertEmpty($this->config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,19 +44,19 @@ class phpbb_console_command_cron_list_test extends phpbb_test_case
|
||||||
public function test_no_task()
|
public function test_no_task()
|
||||||
{
|
{
|
||||||
$this->initiate_test(0, 0);
|
$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()
|
public function test_only_ready()
|
||||||
{
|
{
|
||||||
$this->initiate_test(2, 0);
|
$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()
|
public function test_only_not_ready()
|
||||||
{
|
{
|
||||||
$this->initiate_test(0, 2);
|
$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()
|
public function test_both_ready()
|
||||||
|
|
|
@ -103,7 +103,7 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case
|
||||||
$command_tester = $this->get_command_tester();
|
$command_tester = $this->get_command_tester();
|
||||||
$exit_status = $command_tester->execute(array('command' => $this->command_name, '--verbose' => true));
|
$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(true, $this->task->executed);
|
||||||
$this->assertSame(0, $exit_status);
|
$this->assertSame(0, $exit_status);
|
||||||
$this->assertSame(false, $this->lock->owns_lock());
|
$this->assertSame(false, $this->lock->owns_lock());
|
||||||
|
@ -119,7 +119,7 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case
|
||||||
$command_tester = $this->get_command_tester();
|
$command_tester = $this->get_command_tester();
|
||||||
$exit_status = $command_tester->execute(array('command' => $this->command_name));
|
$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(false, $this->task->executed);
|
||||||
$this->assertSame(1, $exit_status);
|
$this->assertSame(1, $exit_status);
|
||||||
}
|
}
|
||||||
|
@ -215,7 +215,7 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case
|
||||||
$command_tester = $this->get_command_tester();
|
$command_tester = $this->get_command_tester();
|
||||||
$exit_status = $command_tester->execute(array('command' => $this->command_name, '--verbose' => true));
|
$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(0, $exit_status);
|
||||||
$this->assertSame(false, $this->lock->owns_lock());
|
$this->assertSame(false, $this->lock->owns_lock());
|
||||||
}
|
}
|
||||||
|
@ -240,7 +240,7 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case
|
||||||
$command_tester = $this->get_command_tester();
|
$command_tester = $this->get_command_tester();
|
||||||
$exit_status = $command_tester->execute(array('command' => $this->command_name, 'name' => 'foo'));
|
$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(false, $this->task->executed);
|
||||||
$this->assertSame(2, $exit_status);
|
$this->assertSame(2, $exit_status);
|
||||||
$this->assertSame(false, $this->lock->owns_lock());
|
$this->assertSame(false, $this->lock->owns_lock());
|
||||||
|
@ -251,7 +251,7 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case
|
||||||
$command_tester = $this->get_command_tester();
|
$command_tester = $this->get_command_tester();
|
||||||
$exit_status = $command_tester->execute(array('command' => $this->command_name, 'name' => 'phpbb_cron_task_simple', '--verbose' => true));
|
$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(true, $this->task->executed);
|
||||||
$this->assertSame(0, $exit_status);
|
$this->assertSame(0, $exit_status);
|
||||||
$this->assertSame(false, $this->lock->owns_lock());
|
$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');
|
$command_tester = $this->get_command_tester('100000');
|
||||||
$status = $command_tester->execute(array('command' => $this->command_name, '--no-ansi' => true, '--verbose' => true));
|
$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);
|
$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');
|
$command_tester = $this->get_command_tester('0');
|
||||||
$status = $command_tester->execute(array('command' => $this->command_name, '--no-ansi' => true));
|
$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);
|
$this->assertSame($status, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,8 +60,8 @@ class phpbb_console_command_check_test extends phpbb_test_case
|
||||||
{
|
{
|
||||||
$command_tester = $this->get_command_tester('0');
|
$command_tester = $this->get_command_tester('0');
|
||||||
$status = $command_tester->execute(array('command' => $this->command_name, '--no-ansi' => true, '--verbose' => true));
|
$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->assertStringContainsString($this->language->lang('UPDATE_NEEDED'), $command_tester->getDisplay());
|
||||||
$this->assertContains($this->language->lang('UPDATES_AVAILABLE'), $command_tester->getDisplay());
|
$this->assertStringContainsString($this->language->lang('UPDATES_AVAILABLE'), $command_tester->getDisplay());
|
||||||
$this->assertSame($status, 1);
|
$this->assertSame($status, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ class phpbb_console_command_check_test extends phpbb_test_case
|
||||||
$this->version_helper->set_file_location('acme.corp','foo', 'bar.json');
|
$this->version_helper->set_file_location('acme.corp','foo', 'bar.json');
|
||||||
|
|
||||||
$status = $command_tester->execute(array('command' => $this->command_name, '--no-ansi' => true));
|
$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);
|
$this->assertSame($status, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,6 +81,6 @@ class phpbb_console_user_activate_test extends phpbb_console_user_base
|
||||||
'--deactivate' => $deactivate,
|
'--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->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()
|
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->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'
|
'--email' => 'foo'
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->assertContains('USERNAME_TAKEN', $command_tester->getDisplay());
|
$this->assertStringContainsString('USERNAME_TAKEN', $command_tester->getDisplay());
|
||||||
$this->assertContains('TOO_SHORT', $command_tester->getDisplay());
|
$this->assertStringContainsString('TOO_SHORT', $command_tester->getDisplay());
|
||||||
$this->assertContains('EMAIL_INVALID', $command_tester->getDisplay());
|
$this->assertStringContainsString('EMAIL_INVALID', $command_tester->getDisplay());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ class phpbb_console_user_delete_test extends phpbb_console_user_base
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->assertNull($this->get_user_id('Test'));
|
$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()
|
public function test_delete_non_user()
|
||||||
|
@ -71,7 +71,7 @@ class phpbb_console_user_delete_test extends phpbb_console_user_base
|
||||||
'--delete-posts' => false,
|
'--delete-posts' => false,
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->assertContains('NO_USER', $command_tester->getDisplay());
|
$this->assertStringContainsString('NO_USER', $command_tester->getDisplay());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_delete_cancel()
|
public function test_delete_cancel()
|
||||||
|
|
|
@ -138,13 +138,13 @@ class phpbb_email_parsing_test extends phpbb_test_case
|
||||||
$reflection_template = $this->reflection_template_property->getValue($this->messenger);
|
$reflection_template = $this->reflection_template_property->getValue($this->messenger);
|
||||||
$msg = trim($reflection_template->assign_display('body'));
|
$msg = trim($reflection_template->assign_display('body'));
|
||||||
|
|
||||||
$this->assertContains($author_name, $msg);
|
$this->assertStringContainsString($author_name, $msg);
|
||||||
$this->assertContains($forum_name, $msg);
|
$this->assertStringContainsString($forum_name, $msg);
|
||||||
$this->assertContains($topic_title, $msg);
|
$this->assertStringContainsString($topic_title, $msg);
|
||||||
$this->assertContains($username, $msg);
|
$this->assertStringContainsString($username, $msg);
|
||||||
$this->assertContains(htmlspecialchars_decode($config['sitename']), $msg);
|
$this->assertStringContainsString(htmlspecialchars_decode($config['sitename']), $msg);
|
||||||
$this->assertContains(str_replace('<br />', "\n", "-- \n" . htmlspecialchars_decode($config['board_email_sig'])), $msg);
|
$this->assertStringContainsString(str_replace('<br />', "\n", "-- \n" . htmlspecialchars_decode($config['board_email_sig'])), $msg);
|
||||||
$this->assertNotContains('EMAIL_SIG', $msg);
|
$this->assertStringNotContainsString('EMAIL_SIG', $msg);
|
||||||
$this->assertNotContains('U_STOP_WATCHING_FORUM', $msg);
|
$this->assertStringNotContainsString('U_STOP_WATCHING_FORUM', $msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,7 +94,7 @@ class exception_listener extends phpbb_test_case
|
||||||
|
|
||||||
if (isset($expected['content']))
|
if (isset($expected['content']))
|
||||||
{
|
{
|
||||||
$this->assertContains($expected['content'], $response->getContent());
|
$this->assertStringContainsString($expected['content'], $response->getContent());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,10 +38,10 @@ class phpbb_functional_acp_bbcodes_test extends phpbb_functional_test_case
|
||||||
$crawler = self::submit($form);
|
$crawler = self::submit($form);
|
||||||
|
|
||||||
$html = $crawler->filter('#preview')->html();
|
$html = $crawler->filter('#preview')->html();
|
||||||
$this->assertContains('<div>a</div>', $html);
|
$this->assertStringContainsString('<div>a</div>', $html);
|
||||||
$this->assertContains('<div>b</div>', $html);
|
$this->assertStringContainsString('<div>b</div>', $html);
|
||||||
$this->assertContains('<div>c</div>', $html);
|
$this->assertStringContainsString('<div>c</div>', $html);
|
||||||
$this->assertContains('<div>d</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);
|
$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);
|
$form = $this->get_group_manage_form($group_id);
|
||||||
if (!isset($tick_legend) && !isset($tick_teampage))
|
if (!isset($tick_legend) && !isset($tick_teampage))
|
||||||
|
|
|
@ -31,21 +31,21 @@ class phpbb_functional_acp_permissions_test extends phpbb_functional_test_case
|
||||||
// XXX hardcoded id
|
// XXX hardcoded id
|
||||||
$crawler = self::request('GET', 'adm/index.php?i=16&sid=' . $this->sid);
|
$crawler = self::request('GET', 'adm/index.php?i=16&sid=' . $this->sid);
|
||||||
// these language strings are html
|
// 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()
|
public function test_select_user()
|
||||||
{
|
{
|
||||||
// User permissions
|
// User permissions
|
||||||
$crawler = self::request('GET', 'adm/index.php?i=acp_permissions&icat=16&mode=setting_user_global&sid=' . $this->sid);
|
$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
|
// Select admin
|
||||||
$form = $crawler->selectButton($this->lang('SUBMIT'))->form();
|
$form = $crawler->selectButton($this->lang('SUBMIT'))->form();
|
||||||
$data = array('username[0]' => 'admin');
|
$data = array('username[0]' => 'admin');
|
||||||
$form->setValues($data);
|
$form->setValues($data);
|
||||||
$crawler = self::submit($form);
|
$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()
|
public function permissions_data()
|
||||||
|
@ -93,7 +93,7 @@ class phpbb_functional_acp_permissions_test extends phpbb_functional_test_case
|
||||||
{
|
{
|
||||||
// Get the form
|
// 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);
|
$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
|
// XXX globals for \phpbb\auth\auth, refactor it later
|
||||||
global $db, $cache;
|
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');
|
$data = array("setting[$object_id][0][$permission]" => '0');
|
||||||
$form->setValues($data);
|
$form->setValues($data);
|
||||||
$crawler = self::submit($form);
|
$crawler = self::submit($form);
|
||||||
$this->assertContains($this->lang('AUTH_UPDATED'), $crawler->text());
|
$this->assertStringContainsString($this->lang('AUTH_UPDATED'), $crawler->text());
|
||||||
|
|
||||||
// check acl again
|
// check acl again
|
||||||
$auth = new \phpbb\auth\auth;
|
$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}");
|
$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();
|
$form = $crawler->filter('#user_delete')->selectButton($this->lang('SUBMIT'))->form();
|
||||||
$crawler = self::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)
|
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');
|
$data = array('user_founder' => '1');
|
||||||
$form->setValues($data);
|
$form->setValues($data);
|
||||||
$crawler = self::submit($form);
|
$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
|
// check for logout link
|
||||||
$crawler = self::request('GET', 'index.php');
|
$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()
|
public function test_login_other()
|
||||||
|
@ -30,7 +30,7 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case
|
||||||
$this->create_user('anothertestuser');
|
$this->create_user('anothertestuser');
|
||||||
$this->login('anothertestuser');
|
$this->login('anothertestuser');
|
||||||
$crawler = self::request('GET', 'index.php');
|
$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';
|
$config['auth_method'] = 'foobar';
|
||||||
$this->login('anothertestuser');
|
$this->login('anothertestuser');
|
||||||
$crawler = self::request('GET', 'index.php');
|
$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'";
|
$sql = 'UPDATE ' . CONFIG_TABLE . " SET config_value = 'db' WHERE config_name = 'auth_method'";
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
$config['auth_method'] = 'db';
|
$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
|
// look for a register link, which should be visible only when logged out
|
||||||
$crawler = self::request('GET', 'index.php');
|
$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()
|
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
|
// check that we are logged in
|
||||||
$crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid);
|
$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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,7 +84,7 @@ abstract class phpbb_functional_common_avatar_test_case extends phpbb_functional
|
||||||
}
|
}
|
||||||
catch (Exception $e)
|
catch (Exception $e)
|
||||||
{
|
{
|
||||||
$this->assertContains($expected, $crawler->text());
|
$this->assertStringContainsString($expected, $crawler->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($delete)
|
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);
|
$crawler = self::request('GET', 'adm/index.php?i=board&mode=avatar&sid=' . $this->sid);
|
||||||
// Check the default entries we should have
|
// Check the default entries we should have
|
||||||
$this->assertContains($this->lang('ALLOW_REMOTE_UPLOAD'), $crawler->text());
|
$this->assertStringContainsString($this->lang('ALLOW_REMOTE_UPLOAD'), $crawler->text());
|
||||||
$this->assertContains($this->lang('ALLOW_AVATARS'), $crawler->text());
|
$this->assertStringContainsString($this->lang('ALLOW_AVATARS'), $crawler->text());
|
||||||
$this->assertContains($this->lang('ALLOW_LOCAL'), $crawler->text());
|
$this->assertStringContainsString($this->lang('ALLOW_LOCAL'), $crawler->text());
|
||||||
|
|
||||||
// Now start setting the needed settings
|
// Now start setting the needed settings
|
||||||
$form = $crawler->selectButton($this->lang('SUBMIT'))->form();
|
$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]']->select(1);
|
||||||
$form['config[allow_avatar_remote_upload]']->select(1);
|
$form['config[allow_avatar_remote_upload]']->select(1);
|
||||||
$crawler = self::submit($form);
|
$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()
|
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 = $this->get_group_manage_form();
|
||||||
$form['group_colour']->setValue($input);
|
$form['group_colour']->setValue($input);
|
||||||
$crawler = self::submit($form);
|
$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()
|
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['avatar_driver']->setValue($avatar_type);
|
||||||
$form[$form_name]->setValue($input);
|
$form[$form_name]->setValue($input);
|
||||||
$crawler = self::submit($form);
|
$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));
|
$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}");
|
$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['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');
|
$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));
|
$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}");
|
$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'];
|
$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());
|
$this->assertContainsLang('POST_DELETED', $crawler->text());
|
||||||
|
|
||||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Download Topic #1']}&sid={$this->sid}");
|
$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()
|
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());
|
$this->assertContainsLang('TOPIC_DELETED_SUCCESS', $crawler->text());
|
||||||
|
|
||||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Download Topic #1']}&sid={$this->sid}");
|
$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()
|
public function test_download_softdeleted_topic()
|
||||||
|
|
|
@ -88,27 +88,27 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case
|
||||||
$this->assertCount(1, $crawler->filter('.ext_enabled'));
|
$this->assertCount(1, $crawler->filter('.ext_enabled'));
|
||||||
$this->assertCount(7, $crawler->filter('.ext_disabled'));
|
$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->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('DETAILS', $crawler->filter('.ext_disabled')->eq(2)->text());
|
||||||
$this->assertContainsLang('EXTENSION_ENABLE', $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->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('DETAILS', $crawler->filter('.ext_disabled')->eq(3)->text());
|
||||||
$this->assertContainsLang('EXTENSION_ENABLE', $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.
|
// Check that invalid extensions are not listed.
|
||||||
$this->assertNotContains('phpBB BarFoo Extension', $crawler->filter('.table1')->text());
|
$this->assertStringNotContainsString('phpBB BarFoo Extension', $crawler->filter('.table1')->text());
|
||||||
$this->assertNotContains('barfoo', $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()
|
public function test_details()
|
||||||
|
@ -143,7 +143,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case
|
||||||
{
|
{
|
||||||
$match = true;
|
$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());
|
$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);
|
$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
|
// 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);
|
$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
|
// 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);
|
$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->assertStringContainsString('Reason 1', $crawler->filter('.errorbox')->text());
|
||||||
$this->assertContains('Reason 2', $crawler->filter('.errorbox')->text());
|
$this->assertStringContainsString('Reason 2', $crawler->filter('.errorbox')->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_disable_pre()
|
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());
|
$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);
|
$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()
|
public function test_delete_data_pre()
|
||||||
{
|
{
|
||||||
// test2 is not available (error)
|
// 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);
|
$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)
|
// 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);
|
$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());
|
$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);
|
$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()
|
public function test_actions()
|
||||||
|
|
|
@ -62,7 +62,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
|
||||||
$this->phpbb_extension_manager->enable('foo/bar');
|
$this->phpbb_extension_manager->enable('foo/bar');
|
||||||
$crawler = self::request('GET', 'app.php/foo/bar', array(), false);
|
$crawler = self::request('GET', 'app.php/foo/bar', array(), false);
|
||||||
self::assert_response_status_code();
|
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');
|
$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');
|
$this->phpbb_extension_manager->enable('foo/foo');
|
||||||
$crawler = self::request('GET', 'app.php/foo/foo', array(), false);
|
$crawler = self::request('GET', 'app.php/foo/foo', array(), false);
|
||||||
self::assert_response_status_code();
|
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');
|
$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');
|
$this->phpbb_extension_manager->enable('foo/bar');
|
||||||
$crawler = self::request('GET', 'app.php/foo/template');
|
$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');
|
$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()
|
public function test_controller_template_include_js_css()
|
||||||
{
|
{
|
||||||
$crawler = self::request('GET', 'app.php/help/faq');
|
$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');
|
$this->phpbb_extension_manager->enable('foo/bar');
|
||||||
$crawler = self::request('GET', 'app.php/foo/baz', array(), false);
|
$crawler = self::request('GET', 'app.php/foo/baz', array(), false);
|
||||||
$this->assert_response_html(500);
|
$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');
|
$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');
|
$this->phpbb_extension_manager->enable('foo/bar');
|
||||||
$crawler = self::request('GET', 'app.php/foo/exception', array(), false);
|
$crawler = self::request('GET', 'app.php/foo/exception', array(), false);
|
||||||
$this->assert_response_html(500);
|
$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');
|
$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);
|
$crawler = self::request('GET', 'app.php/does/not/exist', array(), false);
|
||||||
$this->assert_response_html(404);
|
$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());
|
$this->assertStringStartsWith('./app.php/foo/login_redirect', $form->get('redirect')->getValue());
|
||||||
|
|
||||||
$crawler = self::submit($form);
|
$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');
|
$this->phpbb_extension_manager->purge('foo/bar');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,9 +67,9 @@ class phpbb_functional_extension_global_lang_test extends phpbb_functional_test_
|
||||||
$crawler = self::request('GET', 'index.php');
|
$crawler = self::request('GET', 'index.php');
|
||||||
|
|
||||||
// language from language/en/common.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
|
// 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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,7 +118,7 @@ class phpbb_functional_extension_module_test extends phpbb_functional_test_case
|
||||||
$this->admin_login();
|
$this->admin_login();
|
||||||
|
|
||||||
$crawler = self::request('GET', 'adm/index.php?i=foo%5cbar%5cacp%5cmain_module&mode=mode&sid=' . $this->sid);
|
$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()
|
public function test_ucp()
|
||||||
|
@ -126,11 +126,11 @@ class phpbb_functional_extension_module_test extends phpbb_functional_test_case
|
||||||
$this->login();
|
$this->login();
|
||||||
|
|
||||||
$crawler = self::request('GET', 'ucp.php?sid=' . $this->sid);
|
$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();
|
$link = $crawler->selectLink('UCP_FOOBAR_TITLE')->link()->getUri();
|
||||||
$crawler = self::request('GET', substr($link, strpos($link, 'ucp.')));
|
$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');
|
$this->phpbb_extension_manager->purge('foo/bar');
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,9 +78,9 @@ class phpbb_functional_extension_permission_lang_test extends phpbb_functional_t
|
||||||
$crawler = self::submit($form);
|
$crawler = self::submit($form);
|
||||||
|
|
||||||
// language from language/en/acp/permissions_phpbb.php
|
// 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
|
// 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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
|
||||||
$this->add_lang('acp/permissions');
|
$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");
|
$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 = $crawler->selectButton($this->lang('APPLY_PERMISSIONS'))->form();
|
||||||
$form['setting[1][0][u_download]']->select(-1);
|
$form['setting[1][0][u_download]']->select(-1);
|
||||||
|
@ -338,7 +338,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.');
|
$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}");
|
$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['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');
|
$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 +346,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.');
|
$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}");
|
$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'];
|
$this->data['posts']['Re: Feeds #news - Topic #2'] = (int) $post2['post_id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -502,7 +502,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.');
|
$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}");
|
$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'];
|
$this->data['posts']['Re: Feeds #1 - Topic #2'] = (int) $post2['post_id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -530,7 +530,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
|
||||||
self::assertContainsLang('POST_DELETED', $crawler->text());
|
self::assertContainsLang('POST_DELETED', $crawler->text());
|
||||||
|
|
||||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Feeds #1 - Topic #2']}&sid={$this->sid}");
|
$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()
|
public function test_feeds_softdeleted_post_admin()
|
||||||
|
@ -630,7 +630,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
|
||||||
self::assertContainsLang('TOPIC_DELETED_SUCCESS', $crawler->text());
|
self::assertContainsLang('TOPIC_DELETED_SUCCESS', $crawler->text());
|
||||||
|
|
||||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Feeds #1 - Topic #2']}&sid={$this->sid}");
|
$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()
|
public function test_feeds_softdeleted_topic_admin()
|
||||||
|
@ -769,7 +769,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');
|
$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}");
|
$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()
|
public function test_feeds_unapproved_post_admin()
|
||||||
|
@ -860,7 +860,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');
|
$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}");
|
$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->logout();
|
||||||
$this->set_flood_interval(15);
|
$this->set_flood_interval(15);
|
||||||
|
@ -1012,7 +1012,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));
|
$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}");
|
$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'];
|
$this->data['topics']['Feeds #1 - Topic #3'] = (int) $post['topic_id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1230,7 +1230,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]');
|
$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}");
|
$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'];
|
$this->data['posts']['Re: Feeds #1 - Topic #3-1'] = (int) $post2['post_id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1395,7 +1395,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
|
||||||
foreach($data['contents'] as $entry_id => $string)
|
foreach($data['contents'] as $entry_id => $string)
|
||||||
{
|
{
|
||||||
$content = $crawler->filterXPath("//entry[{$entry_id}]/content")->text();
|
$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 +1420,13 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
|
||||||
|
|
||||||
if ($attachment['displayed'])
|
if ($attachment['displayed'])
|
||||||
{
|
{
|
||||||
self::assertContains($url, $content, "Tested feed : 'app.php/feed{$params}'");
|
self::assertStringContainsString($url, $content, "Tested feed : 'app.php/feed{$params}'");
|
||||||
self::assertNotContains($string, $content, "Tested feed : 'app.php/feed{$params}'");
|
self::assertStringNotContainsString($string, $content, "Tested feed : 'app.php/feed{$params}'");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
self::assertContains($string, $content, "Tested feed : 'app.php/feed{$params}'");
|
self::assertStringContainsString($string, $content, "Tested feed : 'app.php/feed{$params}'");
|
||||||
self::assertNotContains($url, $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');
|
$crawler = $this->upload_file('valid.jpg', 'image/jpeg');
|
||||||
|
|
||||||
// Ensure there was no error message rendered
|
// 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
|
// 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());
|
$this->assertEquals('valid.jpg', $crawler->filter('span.file-name')->eq(1)->text());
|
||||||
|
|
|
@ -41,7 +41,7 @@ class phpbb_functional_forgot_password_test extends phpbb_functional_test_case
|
||||||
$this->logout();
|
$this->logout();
|
||||||
|
|
||||||
$crawler = self::request('GET', 'app.php/user/forgot_password');
|
$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,25 +19,26 @@ class phpbb_functional_forum_style_test extends phpbb_functional_test_case
|
||||||
public function test_font_awesome_style()
|
public function test_font_awesome_style()
|
||||||
{
|
{
|
||||||
$crawler = self::request('GET', 'viewtopic.php?t=1&f=2');
|
$crawler = self::request('GET', 'viewtopic.php?t=1&f=2');
|
||||||
$this->assertContains('font-awesome.min', $crawler->filter('head > link[rel=stylesheet]')->eq(0)->attr('href'));
|
$this->assertStringContainsString('font-awesome.min', $crawler->filter('head > link[rel=stylesheet]')->eq(0)->attr('href'));
|
||||||
|
|
||||||
$crawler = self::request('GET', 'viewtopic.php?t=1');
|
$crawler = self::request('GET', 'viewtopic.php?t=1');
|
||||||
$this->assertContains('font-awesome.min', $crawler->filter('head > link[rel=stylesheet]')->eq(0)->attr('href'));
|
$this->assertStringContainsString('font-awesome.min', $crawler->filter('head > link[rel=stylesheet]')->eq(0)->attr('href'));
|
||||||
|
|
||||||
$crawler = self::request('GET', 'viewtopic.php?t=1&view=next');
|
$crawler = self::request('GET', 'viewtopic.php?t=1&view=next');
|
||||||
$this->assertContains('font-awesome.min', $crawler->filter('head > link[rel=stylesheet]')->eq(0)->attr('href'));
|
$this->assertStringContainsString('font-awesome.min', $crawler->filter('head > link[rel=stylesheet]')->eq(0)->attr('href'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_default_forum_style()
|
public function test_default_forum_style()
|
||||||
{
|
{
|
||||||
$crawler = self::request('GET', 'viewtopic.php?t=1&f=2');
|
$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(2)->attr('href'));
|
||||||
|
|
||||||
$crawler = self::request('GET', 'viewtopic.php?t=1');
|
$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(2)->attr('href'));
|
||||||
|
|
||||||
$crawler = self::request('GET', 'viewtopic.php?t=1&view=next');
|
$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(2)->attr('href'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_custom_forum_style()
|
public function test_custom_forum_style()
|
||||||
|
@ -47,6 +48,7 @@ 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');
|
$db->sql_query('UPDATE ' . FORUMS_TABLE . ' SET forum_style = 2 WHERE forum_id = 2');
|
||||||
|
|
||||||
$crawler = self::request('GET', 'viewtopic.php?t=1&f=2');
|
$crawler = self::request('GET', 'viewtopic.php?t=1&f=2');
|
||||||
|
<<<<<<< HEAD
|
||||||
$this->assertContains('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href'));
|
$this->assertContains('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href'));
|
||||||
|
|
||||||
$crawler = self::request('GET', 'viewtopic.php?t=1');
|
$crawler = self::request('GET', 'viewtopic.php?t=1');
|
||||||
|
@ -54,6 +56,15 @@ class phpbb_functional_forum_style_test extends phpbb_functional_test_case
|
||||||
|
|
||||||
$crawler = self::request('GET', 'viewtopic.php?t=1&view=next');
|
$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->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(2)->attr('href'));
|
||||||
|
|
||||||
|
$crawler = self::request('GET', 'viewtopic.php?t=1');
|
||||||
|
$this->assertStringContainsString('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->eq(2)->attr('href'));
|
||||||
|
|
||||||
|
$crawler = self::request('GET', 'viewtopic.php?t=1&view=next');
|
||||||
|
$this->assertStringContainsString('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->eq(2)->attr('href'));
|
||||||
|
>>>>>>> 33be5dc489... [ticket/16549] Move from assert[Not]Contains to assertString[Not]ContainsString
|
||||||
|
|
||||||
$db->sql_query('UPDATE ' . FORUMS_TABLE . ' SET forum_style = 0 WHERE forum_id = 2');
|
$db->sql_query('UPDATE ' . FORUMS_TABLE . ' SET forum_style = 0 WHERE forum_id = 2');
|
||||||
$this->delete_style(2, 'test_style');
|
$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)
|
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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.');
|
$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}");
|
$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;
|
return $crawler;
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ class phpbb_functional_mcp_test extends phpbb_functional_test_case
|
||||||
));
|
));
|
||||||
$form['post_id_list'][0]->tick();
|
$form['post_id_list'][0]->tick();
|
||||||
$crawler = self::submit($form);
|
$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;
|
return $crawler;
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ class phpbb_functional_mcp_test extends phpbb_functional_test_case
|
||||||
$this->add_lang('mcp');
|
$this->add_lang('mcp');
|
||||||
$form = $crawler->selectButton('Yes')->form();
|
$form = $crawler->selectButton('Yes')->form();
|
||||||
$crawler = self::submit($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()
|
public function test_delete_logs()
|
||||||
|
|
|
@ -22,15 +22,15 @@ class phpbb_functional_memberlist_test extends phpbb_functional_test_case
|
||||||
// logs in as admin
|
// logs in as admin
|
||||||
$this->login();
|
$this->login();
|
||||||
$crawler = self::request('GET', 'memberlist.php?sid=' . $this->sid);
|
$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
|
// restrict by first character
|
||||||
$crawler = self::request('GET', 'memberlist.php?first_char=m&sid=' . $this->sid);
|
$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
|
// make sure results for wrong character are not returned
|
||||||
$crawler = self::request('GET', 'memberlist.php?first_char=a&sid=' . $this->sid);
|
$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()
|
public function test_viewprofile()
|
||||||
|
@ -38,7 +38,7 @@ class phpbb_functional_memberlist_test extends phpbb_functional_test_case
|
||||||
$this->login();
|
$this->login();
|
||||||
// XXX hardcoded user id
|
// XXX hardcoded user id
|
||||||
$crawler = self::request('GET', 'memberlist.php?mode=viewprofile&u=2&sid=' . $this->sid);
|
$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()
|
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();
|
$crawler = $this->get_memberlist_leaders_table_crawler();
|
||||||
|
|
||||||
// Admin in admin group, but not in moderators
|
// Admin in admin group, but not in moderators
|
||||||
$this->assertContains('admin', $crawler->eq(0)->text());
|
$this->assertStringContainsString('admin', $crawler->eq(0)->text());
|
||||||
$this->assertNotContains('admin', $crawler->eq(1)->text());
|
$this->assertStringNotContainsString('admin', $crawler->eq(1)->text());
|
||||||
|
|
||||||
// memberlist-test-user in neither group
|
// memberlist-test-user in neither group
|
||||||
$this->assertNotContains('memberlist-test-user', $crawler->eq(0)->text());
|
$this->assertStringNotContainsString('memberlist-test-user', $crawler->eq(0)->text());
|
||||||
$this->assertNotContains('memberlist-test-user', $crawler->eq(1)->text());
|
$this->assertStringNotContainsString('memberlist-test-user', $crawler->eq(1)->text());
|
||||||
|
|
||||||
// memberlist-test-moderator in neither group
|
// memberlist-test-moderator in neither group
|
||||||
$this->assertNotContains('memberlist-test-moderator', $crawler->eq(0)->text());
|
$this->assertStringNotContainsString('memberlist-test-moderator', $crawler->eq(0)->text());
|
||||||
$this->assertNotContains('memberlist-test-moderator', $crawler->eq(1)->text());
|
$this->assertStringNotContainsString('memberlist-test-moderator', $crawler->eq(1)->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_leaders_remove_users()
|
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
|
// Remove admin from admins, but is now in moderators
|
||||||
$this->remove_user_group('ADMINISTRATORS', array('admin'));
|
$this->remove_user_group('ADMINISTRATORS', array('admin'));
|
||||||
$crawler = $this->get_memberlist_leaders_table_crawler();
|
$crawler = $this->get_memberlist_leaders_table_crawler();
|
||||||
$this->assertNotContains('admin', $crawler->eq(0)->text());
|
$this->assertStringNotContainsString('admin', $crawler->eq(0)->text());
|
||||||
$this->assertContains('admin', $crawler->eq(1)->text());
|
$this->assertStringContainsString('admin', $crawler->eq(1)->text());
|
||||||
|
|
||||||
// Remove admin from moderators, should not be visible anymore
|
// Remove admin from moderators, should not be visible anymore
|
||||||
$this->remove_user_group('GLOBAL_MODERATORS', array('admin'));
|
$this->remove_user_group('GLOBAL_MODERATORS', array('admin'));
|
||||||
$crawler = $this->get_memberlist_leaders_table_crawler();
|
$crawler = $this->get_memberlist_leaders_table_crawler();
|
||||||
$this->assertNotContains('admin', $crawler->eq(0)->text());
|
$this->assertStringNotContainsString('admin', $crawler->eq(0)->text());
|
||||||
$this->assertNotContains('admin', $crawler->eq(1)->text());
|
$this->assertStringNotContainsString('admin', $crawler->eq(1)->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_leaders_add_users()
|
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
|
// Add memberlist-test-moderator to moderators
|
||||||
$this->add_user_group('GLOBAL_MODERATORS', array('memberlist-test-moderator'));
|
$this->add_user_group('GLOBAL_MODERATORS', array('memberlist-test-moderator'));
|
||||||
$crawler = $this->get_memberlist_leaders_table_crawler();
|
$crawler = $this->get_memberlist_leaders_table_crawler();
|
||||||
$this->assertNotContains('memberlist-test-moderator', $crawler->eq(0)->text());
|
$this->assertStringNotContainsString('memberlist-test-moderator', $crawler->eq(0)->text());
|
||||||
$this->assertContains('memberlist-test-moderator', $crawler->eq(1)->text());
|
$this->assertStringContainsString('memberlist-test-moderator', $crawler->eq(1)->text());
|
||||||
|
|
||||||
// Add admin to moderators, should be visible as moderator
|
// Add admin to moderators, should be visible as moderator
|
||||||
$this->add_user_group('GLOBAL_MODERATORS', array('admin'), true);
|
$this->add_user_group('GLOBAL_MODERATORS', array('admin'), true);
|
||||||
$crawler = $this->get_memberlist_leaders_table_crawler();
|
$crawler = $this->get_memberlist_leaders_table_crawler();
|
||||||
$this->assertNotContains('admin', $crawler->eq(0)->text());
|
$this->assertStringNotContainsString('admin', $crawler->eq(0)->text());
|
||||||
$this->assertContains('admin', $crawler->eq(1)->text());
|
$this->assertStringContainsString('admin', $crawler->eq(1)->text());
|
||||||
|
|
||||||
// Add admin to admins as leader, should be visible as admin, not moderator
|
// Add admin to admins as leader, should be visible as admin, not moderator
|
||||||
$this->add_user_group('ADMINISTRATORS', array('admin'), true, true);
|
$this->add_user_group('ADMINISTRATORS', array('admin'), true, true);
|
||||||
$crawler = $this->get_memberlist_leaders_table_crawler();
|
$crawler = $this->get_memberlist_leaders_table_crawler();
|
||||||
$this->assertContains('admin', $crawler->eq(0)->text());
|
$this->assertStringContainsString('admin', $crawler->eq(0)->text());
|
||||||
$this->assertNotContains('admin', $crawler->eq(1)->text());
|
$this->assertStringNotContainsString('admin', $crawler->eq(1)->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_group_rank()
|
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());
|
$this->assertContainsLang('RANK_UPDATED', $crawler->filter('.successbox')->text());
|
||||||
|
|
||||||
$crawler = self::request('GET', 'memberlist.php?mode=group&g=2');
|
$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');
|
unlink(__DIR__ . '/../../phpBB/images/ranks/valid.jpg');
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,9 +63,9 @@ class phpbb_functional_metadata_manager_test extends phpbb_functional_test_case
|
||||||
public function test_extensions_list()
|
public function test_extensions_list()
|
||||||
{
|
{
|
||||||
$crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&sid=' . $this->sid);
|
$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->assertStringContainsString($this->lang('EXTENSIONS_EXPLAIN'), $crawler->filter('#main')->text());
|
||||||
$this->assertContains('phpBB 3.1 Extension Testing', $crawler->filter('#main')->text());
|
$this->assertStringContainsString('phpBB 3.1 Extension Testing', $crawler->filter('#main')->text());
|
||||||
$this->assertContains('Details', $crawler->filter('#main')->text());
|
$this->assertStringContainsString('Details', $crawler->filter('#main')->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_extensions_details()
|
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);
|
$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
|
// Test whether the details are displayed
|
||||||
$this->assertContains($this->lang('CLEAN_NAME'), $crawler->filter('#main')->text());
|
$this->assertStringContainsString($this->lang('CLEAN_NAME'), $crawler->filter('#main')->text());
|
||||||
$this->assertContains('foo/bar', $crawler->filter('#meta_name')->text());
|
$this->assertStringContainsString('foo/bar', $crawler->filter('#meta_name')->text());
|
||||||
|
|
||||||
$this->assertContains($this->lang('PHP_VERSION'), $crawler->filter('#main')->text());
|
$this->assertStringContainsString($this->lang('PHP_VERSION'), $crawler->filter('#main')->text());
|
||||||
$this->assertContains('>=5.3', $crawler->filter('#require_php')->text());
|
$this->assertStringContainsString('>=5.3', $crawler->filter('#require_php')->text());
|
||||||
// Details should be html escaped
|
// Details should be html escaped
|
||||||
// However, text() only returns the displayed text, so HTML Special Chars are decoded.
|
// However, text() only returns the displayed text, so HTML Special Chars are decoded.
|
||||||
// So we test this directly on the content of the response.
|
// 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()
|
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);
|
$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
|
// 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
|
// 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');
|
$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}");
|
$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
|
// Login as admin
|
||||||
$this->logout();
|
$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.');
|
$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}");
|
$crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
|
||||||
$this->assertContains('post no4', $crawler->text());
|
$this->assertStringContainsString('post no4', $crawler->text());
|
||||||
$this->assertNotContains('post no16', $crawler->text());
|
$this->assertStringNotContainsString('post no16', $crawler->text());
|
||||||
|
|
||||||
$next_link = $crawler->filter('.pagination > ul > li.next > a')->attr('href');
|
$next_link = $crawler->filter('.pagination > ul > li.next > a')->attr('href');
|
||||||
$crawler = self::request('GET', $next_link);
|
$crawler = self::request('GET', $next_link);
|
||||||
$this->assertNotContains('post no4', $crawler->text());
|
$this->assertStringNotContainsString('post no4', $crawler->text());
|
||||||
$this->assertContains('post no16', $crawler->text());
|
$this->assertStringContainsString('post no16', $crawler->text());
|
||||||
|
|
||||||
$prev_link = $crawler->filter('.pagination > ul > li.previous > a')->attr('href');
|
$prev_link = $crawler->filter('.pagination > ul > li.previous > a')->attr('href');
|
||||||
$crawler = self::request('GET', $prev_link);
|
$crawler = self::request('GET', $prev_link);
|
||||||
$this->assertContains('post no4', $crawler->text());
|
$this->assertStringContainsString('post no4', $crawler->text());
|
||||||
$this->assertNotContains('post no16', $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)
|
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
|
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.');
|
$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}");
|
$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
|
// 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.');
|
$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}");
|
$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
|
// 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}");
|
$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()
|
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.');
|
$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.');
|
$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}");
|
$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()
|
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.');
|
$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");
|
$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}");
|
$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()
|
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.');
|
$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->create_post(2, $post['topic_id'], 'Re: Test Topic 1', '😀');
|
||||||
$crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
|
$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()
|
public function test_quote()
|
||||||
|
@ -96,7 +96,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
|
||||||
$form->setValues(array('message' => 'Edited post'));
|
$form->setValues(array('message' => 'Edited post'));
|
||||||
$crawler = self::submit($form);
|
$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();
|
$text_content = $crawler->filter('#p' . $post['post_id'])->text();
|
||||||
foreach ($contains[$quote_depth] as $contains_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)
|
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',
|
'message' => 'My post',
|
||||||
));
|
));
|
||||||
$crawler = self::submit($form);
|
$crawler = self::submit($form);
|
||||||
$this->assertContains(
|
$this->assertStringContainsString(
|
||||||
'<strong class="text-strong">My signature</strong>',
|
'<strong class="text-strong">My signature</strong>',
|
||||||
$crawler->filter('#preview .signature')->html()
|
$crawler->filter('#preview .signature')->html()
|
||||||
);
|
);
|
||||||
|
@ -274,7 +274,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
|
||||||
'message' => $text,
|
'message' => $text,
|
||||||
));
|
));
|
||||||
$crawler = self::submit($form);
|
$crawler = self::submit($form);
|
||||||
$this->assertContains(
|
$this->assertStringContainsString(
|
||||||
'<a href="http://example.org/" class="postlink">http://example.org/</a> tcp://localhost:22/ServiceName',
|
'<a href="http://example.org/" class="postlink">http://example.org/</a> tcp://localhost:22/ServiceName',
|
||||||
$crawler->filter('#preview .content')->html()
|
$crawler->filter('#preview .content')->html()
|
||||||
);
|
);
|
||||||
|
@ -295,7 +295,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
|
||||||
'message' => $text,
|
'message' => $text,
|
||||||
));
|
));
|
||||||
$crawler = self::submit($form);
|
$crawler = self::submit($form);
|
||||||
$this->assertContains(
|
$this->assertStringContainsString(
|
||||||
'http://example.org/ <a href="tcp://localhost:22/ServiceName" class="postlink">tcp://localhost:22/ServiceName</a>',
|
'http://example.org/ <a href="tcp://localhost:22/ServiceName" class="postlink">tcp://localhost:22/ServiceName</a>',
|
||||||
$crawler->filter('#preview .content')->html()
|
$crawler->filter('#preview .content')->html()
|
||||||
);
|
);
|
||||||
|
|
|
@ -32,7 +32,7 @@ class phpbb_functional_private_messages_test extends phpbb_functional_test_case
|
||||||
$form->setValues($values);
|
$form->setValues($values);
|
||||||
|
|
||||||
$crawler = self::submit($form);
|
$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()
|
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));
|
$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}");
|
$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));
|
$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}");
|
$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()
|
public function test_restore_config()
|
||||||
|
@ -64,7 +64,7 @@ class phpbb_functional_private_messages_test extends phpbb_functional_test_case
|
||||||
$form->setValues($values);
|
$form->setValues($values);
|
||||||
|
|
||||||
$crawler = self::submit($form);
|
$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()
|
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);
|
$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.');
|
$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}");
|
$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['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');
|
$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.');
|
$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}");
|
$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->data['posts']['Re: Prune Shadow #1-#2'] = (int) $post2['post_id'];
|
||||||
|
|
||||||
$this->assert_forum_details($this->data['forums']['Prune Shadow'], array(
|
$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);
|
$crawler = self::request('GET', 'app.php/post/1/report', array(), false);
|
||||||
$this->assert_response_html(403);
|
$this->assert_response_html(403);
|
||||||
$this->add_lang('mcp');
|
$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);
|
$this->set_reporting_guest(1);
|
||||||
$crawler = self::request('GET', 'app.php/post/1/report');
|
$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);
|
$this->set_reporting_guest(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,12 +33,12 @@ class phpbb_functional_report_post_captcha_test extends phpbb_functional_test_ca
|
||||||
{
|
{
|
||||||
$this->login();
|
$this->login();
|
||||||
$crawler = self::request('GET', 'app.php/post/1/report');
|
$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');
|
$this->add_lang('mcp');
|
||||||
$form = $crawler->selectButton($this->lang('SUBMIT'))->form();
|
$form = $crawler->selectButton($this->lang('SUBMIT'))->form();
|
||||||
$crawler = self::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)
|
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()
|
public function test_display_subforums()
|
||||||
{
|
{
|
||||||
$crawler = self::request('GET', "index.php?sid={$this->sid}");
|
$crawler = self::request('GET', "index.php?sid={$this->sid}");
|
||||||
$this->assertContains('Subforum Test #1.1', $crawler->html());
|
$this->assertStringContainsString('Subforum Test #1.1', $crawler->html());
|
||||||
$this->assertContains('Subforum Test #1.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);
|
self::submit($form);
|
||||||
|
|
||||||
$crawler = self::request('GET', "index.php?sid={$this->sid}");
|
$crawler = self::request('GET', "index.php?sid={$this->sid}");
|
||||||
$this->assertContains('Subforum Test #1.1', $crawler->html());
|
$this->assertStringContainsString('Subforum Test #1.1', $crawler->html());
|
||||||
$this->assertNotContains('Subforum Test #1.1.1', $crawler->html());
|
$this->assertStringNotContainsString('Subforum Test #1.1.1', $crawler->html());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function get_forum_id($forum_name)
|
protected function get_forum_id($forum_name)
|
||||||
|
|
|
@ -51,7 +51,7 @@ class phpbb_functional_ucp_groups_test extends phpbb_functional_common_groups_te
|
||||||
$form = $this->get_group_manage_form();
|
$form = $this->get_group_manage_form();
|
||||||
$teampage_settings = $this->get_teampage_settings();
|
$teampage_settings = $this->get_teampage_settings();
|
||||||
$crawler = self::submit($form);
|
$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());
|
$this->assertEquals($teampage_settings, $this->get_teampage_settings());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ class phpbb_functional_user_password_reset_test extends phpbb_functional_test_ca
|
||||||
|
|
||||||
// test without email
|
// test without email
|
||||||
$crawler = self::request('GET', "ucp.php?mode=sendpassword&sid={$this->sid}");
|
$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();
|
$form = $crawler->selectButton('submit')->form();
|
||||||
$crawler = self::submit($form);
|
$crawler = self::submit($form);
|
||||||
$this->assertContainsLang('NO_EMAIL_USER', $crawler->text());
|
$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');
|
$this->add_lang('ucp');
|
||||||
$crawler = self::request('GET', 'ucp.php');
|
$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();
|
$form = $crawler->selectButton($this->lang('LOGIN'))->form();
|
||||||
$crawler = self::submit($form, array('username' => 'reset-password-test-user', 'password' => 'reset-password-test-user'));
|
$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();
|
$cookies = self::$cookieJar->all();
|
||||||
|
|
||||||
|
@ -163,12 +163,12 @@ class phpbb_functional_user_password_reset_test extends phpbb_functional_test_ca
|
||||||
$this->logout();
|
$this->logout();
|
||||||
|
|
||||||
$crawler = self::request('GET', 'ucp.php');
|
$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();
|
$form = $crawler->selectButton($this->lang('LOGIN'))->form();
|
||||||
// Try logging in with the old password
|
// 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'));
|
$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());
|
$this->assertEquals(2, $crawler->filter('div.pagination')->count());
|
||||||
$top_pagination = $crawler->filter('div.pagination')->eq(0);
|
$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->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->assertStringContainsString('1', $top_pagination->filter('li')->eq(0)->text());
|
||||||
$this->assertContains('2', $top_pagination->filter('li')->eq(1)->text());
|
$this->assertStringContainsString('2', $top_pagination->filter('li')->eq(1)->text());
|
||||||
$this->assertContainsLang('NEXT', $top_pagination->filter('li')->eq(2)->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);
|
$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->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->assertContainsLang('PREVIOUS', $top_pagination->filter('li')->eq(0)->text());
|
||||||
$this->assertContains('1', $top_pagination->filter('li')->eq(1)->text());
|
$this->assertStringContainsString('1', $top_pagination->filter('li')->eq(1)->text());
|
||||||
$this->assertContains('2', $top_pagination->filter('li')->eq(2)->text());
|
$this->assertStringContainsString('2', $top_pagination->filter('li')->eq(2)->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function assert_forum_details($forum_id, $details, $additional_error_message = '')
|
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.');
|
$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}");
|
$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['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');
|
$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');
|
$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}");
|
$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(
|
$this->assert_forum_details($this->data['forums']['Disapprove Test #1'], array(
|
||||||
'forum_posts_approved' => 1,
|
'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');
|
$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}");
|
$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(
|
$this->assert_forum_details($this->data['forums']['Disapprove Test #1'], array(
|
||||||
'forum_posts_approved' => 1,
|
'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('viewtopic');
|
||||||
$this->add_lang('mcp');
|
$this->add_lang('mcp');
|
||||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Disapprove Test Topic #1']}&sid={$this->sid}");
|
$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->assertStringContainsString('Disapprove Test Topic #1', $crawler->filter('html')->text());
|
||||||
$this->assertContains('Re: Disapprove Test Topic #1-#2', $crawler->filter('html')->text());
|
$this->assertStringContainsString('Re: Disapprove Test Topic #1-#2', $crawler->filter('html')->text());
|
||||||
|
|
||||||
$form = $crawler->selectButton($this->lang('DISAPPROVE'))->form();
|
$form = $crawler->selectButton($this->lang('DISAPPROVE'))->form();
|
||||||
$crawler = self::submit($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 = $crawler->selectLink($this->lang('RETURN_PAGE', '', ''))->link();
|
||||||
$link_url = $link->getUri();
|
$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}");
|
$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->assertStringContainsString('Disapprove Test Topic #1', $crawler->filter('html')->text());
|
||||||
$this->assertNotContains('Re: Disapprove Test Topic #1-#2', $crawler->filter('html')->text());
|
$this->assertStringNotContainsString('Re: Disapprove Test Topic #1-#2', $crawler->filter('html')->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_disapprove_topic()
|
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('viewtopic');
|
||||||
$this->add_lang('mcp');
|
$this->add_lang('mcp');
|
||||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Disapprove Test Topic #2']}&sid={$this->sid}");
|
$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();
|
$form = $crawler->selectButton($this->lang('DISAPPROVE'))->form();
|
||||||
$crawler = self::submit($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 = $crawler->selectLink($this->lang('RETURN_PAGE', '', ''))->link();
|
||||||
$link_url = $link->getUri();
|
$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);
|
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Disapprove Test Topic #2']}&sid={$this->sid}", array(), false);
|
||||||
self::assert_response_html(404);
|
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 = '')
|
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.');
|
$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}");
|
$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['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');
|
$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');
|
$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}");
|
$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(
|
$this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
|
||||||
'forum_posts_approved' => 1,
|
'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');
|
$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}");
|
$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(
|
$this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
|
||||||
'forum_posts_approved' => 1,
|
'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('viewtopic');
|
||||||
$this->add_lang('mcp');
|
$this->add_lang('mcp');
|
||||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #1']}&sid={$this->sid}");
|
$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->assertStringContainsString('Reapprove Test Topic #1', $crawler->filter('h2')->text());
|
||||||
$this->assertContains('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text());
|
$this->assertStringContainsString('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text());
|
||||||
|
|
||||||
$form = $crawler->selectButton($this->lang('APPROVE'))->form();
|
$form = $crawler->selectButton($this->lang('APPROVE'))->form();
|
||||||
$crawler = self::submit($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 = $crawler->selectLink($this->lang('RETURN_PAGE', '', ''))->link();
|
||||||
$link_url = $link->getUri();
|
$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}");
|
$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->assertStringContainsString('Reapprove Test Topic #1', $crawler->filter('h2')->text());
|
||||||
$this->assertContains('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text());
|
$this->assertStringContainsString('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_approve_topic()
|
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('viewtopic');
|
||||||
$this->add_lang('mcp');
|
$this->add_lang('mcp');
|
||||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #2']}&sid={$this->sid}");
|
$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();
|
$form = $crawler->selectButton($this->lang('APPROVE'))->form();
|
||||||
$crawler = self::submit($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 = $crawler->selectLink($this->lang('RETURN_PAGE', '', ''))->link();
|
||||||
$link_url = $link->getUri();
|
$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}");
|
$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()
|
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');
|
$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}");
|
$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->assertNotContains('Post edited by testing framework', $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(
|
$this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
|
||||||
'forum_posts_approved' => 2,
|
'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);
|
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #2']}&sid={$this->sid}", array(), false);
|
||||||
self::assert_response_html(404);
|
self::assert_response_html(404);
|
||||||
$this->assertNotContains('Reapprove Test Topic #2', $crawler->filter('#page-body')->text());
|
$this->assertStringNotContainsString('Reapprove Test Topic #2', $crawler->filter('#page-body')->text());
|
||||||
$this->assertNotContains('Post edited by testing framework', $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(
|
$this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
|
||||||
'forum_posts_approved' => 1,
|
'forum_posts_approved' => 1,
|
||||||
|
@ -314,8 +314,8 @@ class phpbb_functional_visibility_reapprove_test extends phpbb_functional_test_c
|
||||||
$this->login();
|
$this->login();
|
||||||
|
|
||||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #1']}&sid={$this->sid}");
|
$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->assertStringContainsString('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('Post edited by testing framework', $crawler->filter('#page-body')->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_approve_post_again()
|
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.');
|
$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}");
|
$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['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');
|
$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.');
|
$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}");
|
$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->data['posts']['Re: Soft Delete Topic #1-#2'] = (int) $post2['post_id'];
|
||||||
|
|
||||||
$this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
|
$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.');
|
$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}");
|
$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->data['posts']['Re: Soft Delete Topic #1-#3'] = (int) $post3['post_id'];
|
||||||
|
|
||||||
$this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
|
$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');
|
), 'after softdelete');
|
||||||
|
|
||||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
|
$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()
|
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');
|
), 'after softdelete without m_delete');
|
||||||
|
|
||||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
|
$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()
|
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());
|
$this->assertContainsLang('TOPIC_MOVED_SUCCESS', $crawler->text());
|
||||||
|
|
||||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
|
$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->assertStringContainsString('Soft Delete #2', $crawler->filter('.navlinks')->text());
|
||||||
$this->assertContains('Soft Delete Topic #1', $crawler->filter('h2')->text());
|
$this->assertStringContainsString('Soft Delete Topic #1', $crawler->filter('h2')->text());
|
||||||
|
|
||||||
$this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
|
$this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
|
||||||
'forum_posts_approved' => 0,
|
'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());
|
$this->assertContainsLang('TOPIC_DELETED_SUCCESS', $crawler->text());
|
||||||
|
|
||||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
|
$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->assertStringContainsString('Soft Delete #2', $crawler->filter('.navlinks')->text());
|
||||||
$this->assertContains('Soft Delete Topic #1', $crawler->filter('h2')->text());
|
$this->assertStringContainsString('Soft Delete Topic #1', $crawler->filter('h2')->text());
|
||||||
|
|
||||||
$this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
|
$this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
|
||||||
'forum_posts_approved' => 0,
|
'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());
|
$this->assertContainsLang('TOPIC_MOVED_SUCCESS', $crawler->text());
|
||||||
|
|
||||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
|
$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->assertStringContainsString('Soft Delete #1', $crawler->filter('.navlinks')->text());
|
||||||
$this->assertContains('Soft Delete Topic #1', $crawler->filter('h2')->text());
|
$this->assertStringContainsString('Soft Delete Topic #1', $crawler->filter('h2')->text());
|
||||||
|
|
||||||
$this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
|
$this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
|
||||||
'forum_posts_approved' => 0,
|
'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());
|
$this->assertContainsLang('POST_RESTORED_SUCCESS', $crawler->text());
|
||||||
|
|
||||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
|
$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->assertStringContainsString('Soft Delete #1', $crawler->filter('.navlinks')->text());
|
||||||
$this->assertContains('Soft Delete Topic #1', $crawler->filter('h2')->text());
|
$this->assertStringContainsString('Soft Delete Topic #1', $crawler->filter('h2')->text());
|
||||||
|
|
||||||
$this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
|
$this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
|
||||||
'forum_posts_approved' => 1,
|
'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());
|
$this->assertContainsLang('TOPIC_SPLIT_SUCCESS', $crawler->text());
|
||||||
|
|
||||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
|
$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->assertNotContains('Re: Soft Delete Topic #1-#2', $crawler->text());
|
$this->assertStringNotContainsString('Re: Soft Delete Topic #1-#2', $crawler->text());
|
||||||
|
|
||||||
$this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
|
$this->assert_forum_details($this->data['forums']['Soft Delete #1'], array(
|
||||||
'forum_posts_approved' => 1,
|
'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
|
// Assert new topic title is indexed as well
|
||||||
$this->add_lang('search');
|
$this->add_lang('search');
|
||||||
self::request('GET', "search.php?keywords=bang&sid={$this->sid}");
|
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()
|
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());
|
$this->assertContainsLang('POSTS_MERGED_SUCCESS', $crawler->text());
|
||||||
|
|
||||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
|
$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('POST_DELETED_ACTION', $crawler->filter('body')->text());
|
||||||
$this->assertContainsLang('BOOKMARK_TOPIC_REMOVE', $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.');
|
$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}");
|
$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['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');
|
$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');
|
$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}");
|
$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'], [
|
$this->assert_forum_details($this->data['forums']['Unapproved Posts Test #1'], [
|
||||||
'forum_posts_approved' => 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');
|
$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}");
|
$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'], [
|
$this->assert_forum_details($this->data['forums']['Unapproved Posts Test #1'], [
|
||||||
'forum_posts_approved' => 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
|
// 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}");
|
$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->assertStringContainsString('Unapproved Posts Test Topic #1', $crawler->filter('h2')->text());
|
||||||
$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->assertNotContains('This post is not visible to other users until it has been approved', $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
|
// 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}");
|
$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();
|
$this->logout();
|
||||||
|
|
||||||
// another user
|
// 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
|
// 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}");
|
$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->assertStringContainsString('Unapproved Posts Test Topic #1', $crawler->filter('h2')->text());
|
||||||
$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->assertNotContains('This post is not visible to other users until it has been approved', $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
|
// 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}");
|
$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()
|
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
|
// 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}");
|
$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->assertStringContainsString('Unapproved Posts Test Topic #1', $crawler->filter('h2')->text());
|
||||||
$this->assertContains('Re: Unapproved Posts Test Topic #1-#2', $crawler->filter('#page-body')->text());
|
$this->assertStringContainsString('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('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
|
// should be able to see topic 2
|
||||||
$crawler = self::request('GET', "viewforum.php?f={$this->data['forums']['Unapproved Posts Test #1']}&sid={$this->sid}");
|
$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
|
// 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}");
|
$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->assertStringContainsString('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('This post is not visible to other users until it has been approved', $crawler->filter('#page-body')->text());
|
||||||
$this->logout();
|
$this->logout();
|
||||||
|
|
||||||
// another user
|
// 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
|
// 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}");
|
$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->assertStringContainsString('Unapproved Posts Test Topic #1', $crawler->filter('h2')->text());
|
||||||
$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->assertNotContains('This post is not visible to other users until it has been approved', $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
|
// 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}");
|
$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();
|
$this->logout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,12 +19,12 @@ class phpbb_functional_visit_installer_test extends phpbb_functional_test_case
|
||||||
public function test_visit_installer()
|
public function test_visit_installer()
|
||||||
{
|
{
|
||||||
self::request('GET', 'install/', [], false);
|
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);
|
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');
|
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.'
|
'Failed asserting that the second line of the version file is a valid URL.'
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertContains('http', $lines[1]);
|
$this->assertStringContainsString('http', $lines[1]);
|
||||||
$this->assertContains('phpbb.com', $lines[1], '', true);
|
$this->assertStringContainsString('phpbb.com', $lines[1], '', true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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->markTestSkipped("Failed to connect to $hostname: $result");
|
||||||
}
|
}
|
||||||
$this->assertContains('debian', $o->_ls());
|
$this->assertStringContainsString('debian', $o->_ls());
|
||||||
$o->_close();
|
$o->_close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -793,7 +793,7 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||||
$this->add_lang('ucp');
|
$this->add_lang('ucp');
|
||||||
|
|
||||||
$crawler = self::request('GET', 'ucp.php');
|
$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();
|
$form = $crawler->selectButton($this->lang('LOGIN'))->form();
|
||||||
if ($autologin)
|
if ($autologin)
|
||||||
|
@ -801,7 +801,7 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||||
$form['autologin']->tick();
|
$form['autologin']->tick();
|
||||||
}
|
}
|
||||||
$crawler = self::submit($form, array('username' => $username, 'password' => $username . $username));
|
$crawler = self::submit($form, array('username' => $username, 'password' => $username . $username));
|
||||||
$this->assertNotContains($this->lang('LOGIN'), $crawler->filter('.navbar')->text());
|
$this->assertStringNotContainsString($this->lang('LOGIN'), $crawler->filter('.navbar')->text());
|
||||||
|
|
||||||
$cookies = self::$cookieJar->all();
|
$cookies = self::$cookieJar->all();
|
||||||
|
|
||||||
|
@ -820,7 +820,7 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||||
$this->add_lang('ucp');
|
$this->add_lang('ucp');
|
||||||
|
|
||||||
$crawler = self::request('GET', 'ucp.php?sid=' . $this->sid . '&mode=logout');
|
$crawler = self::request('GET', 'ucp.php?sid=' . $this->sid . '&mode=logout');
|
||||||
$this->assertContains($this->lang('REGISTER'), $crawler->filter('.navbar')->text());
|
$this->assertStringContainsString($this->lang('REGISTER'), $crawler->filter('.navbar')->text());
|
||||||
unset($this->sid);
|
unset($this->sid);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -841,7 +841,7 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||||
}
|
}
|
||||||
|
|
||||||
$crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid);
|
$crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid);
|
||||||
$this->assertContains($this->lang('LOGIN_ADMIN_CONFIRM'), $crawler->filter('html')->text());
|
$this->assertStringContainsString($this->lang('LOGIN_ADMIN_CONFIRM'), $crawler->filter('html')->text());
|
||||||
|
|
||||||
$form = $crawler->selectButton($this->lang('LOGIN'))->form();
|
$form = $crawler->selectButton($this->lang('LOGIN'))->form();
|
||||||
|
|
||||||
|
@ -850,7 +850,7 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||||
if (strpos($field, 'password_') === 0)
|
if (strpos($field, 'password_') === 0)
|
||||||
{
|
{
|
||||||
$crawler = self::submit($form, array('username' => $username, $field => $username . $username));
|
$crawler = self::submit($form, array('username' => $username, $field => $username . $username));
|
||||||
$this->assertContains($this->lang('ADMIN_PANEL'), $crawler->filter('h1')->text());
|
$this->assertStringContainsString($this->lang('ADMIN_PANEL'), $crawler->filter('h1')->text());
|
||||||
|
|
||||||
$cookies = self::$cookieJar->all();
|
$cookies = self::$cookieJar->all();
|
||||||
|
|
||||||
|
@ -940,7 +940,7 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||||
*/
|
*/
|
||||||
public function assertContainsLang($needle, $haystack, $message = '')
|
public function assertContainsLang($needle, $haystack, $message = '')
|
||||||
{
|
{
|
||||||
$this->assertContains(html_entity_decode($this->lang($needle), ENT_QUOTES), $haystack, $message);
|
$this->assertStringContainsString(html_entity_decode($this->lang($needle), ENT_QUOTES), $haystack, $message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -952,7 +952,7 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||||
*/
|
*/
|
||||||
public function assertNotContainsLang($needle, $haystack, $message = '')
|
public function assertNotContainsLang($needle, $haystack, $message = '')
|
||||||
{
|
{
|
||||||
$this->assertNotContains(html_entity_decode($this->lang($needle), ENT_QUOTES), $haystack, $message);
|
$this->assertStringNotContainsString(html_entity_decode($this->lang($needle), ENT_QUOTES), $haystack, $message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -967,7 +967,7 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||||
{
|
{
|
||||||
// Any output before the doc type means there was an error
|
// Any output before the doc type means there was an error
|
||||||
$content = self::get_content();
|
$content = self::get_content();
|
||||||
self::assertNotContains('[phpBB Debug]', $content);
|
self::assertStringNotContainsString('[phpBB Debug]', $content);
|
||||||
self::assertStringStartsWith('<!DOCTYPE', trim($content), 'Output found before DOCTYPE specification.');
|
self::assertStringStartsWith('<!DOCTYPE', trim($content), 'Output found before DOCTYPE specification.');
|
||||||
|
|
||||||
if ($status_code !== false)
|
if ($status_code !== false)
|
||||||
|
@ -988,7 +988,7 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||||
{
|
{
|
||||||
// Any output before the xml opening means there was an error
|
// Any output before the xml opening means there was an error
|
||||||
$content = self::get_content();
|
$content = self::get_content();
|
||||||
self::assertNotContains('[phpBB Debug]', $content);
|
self::assertStringNotContainsString('[phpBB Debug]', $content);
|
||||||
self::assertStringStartsWith('<?xml', trim($content), 'Output found before XML specification.');
|
self::assertStringStartsWith('<?xml', trim($content), 'Output found before XML specification.');
|
||||||
|
|
||||||
if ($status_code !== false)
|
if ($status_code !== false)
|
||||||
|
@ -1169,7 +1169,7 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->assertContains($expected, $crawler->filter('html')->text());
|
$this->assertStringContainsString($expected, $crawler->filter('html')->text());
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -1212,7 +1212,7 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||||
|
|
||||||
$crawler = self::submit_message($posting_url, 'POST_NEW_PM', $form_data);
|
$crawler = self::submit_message($posting_url, 'POST_NEW_PM', $form_data);
|
||||||
|
|
||||||
$this->assertContains($this->lang('MESSAGE_STORED'), $crawler->filter('html')->text());
|
$this->assertStringContainsString($this->lang('MESSAGE_STORED'), $crawler->filter('html')->text());
|
||||||
$url = $crawler->selectLink($this->lang('VIEW_PRIVATE_MESSAGE', '', ''))->link()->getUri();
|
$url = $crawler->selectLink($this->lang('VIEW_PRIVATE_MESSAGE', '', ''))->link()->getUri();
|
||||||
|
|
||||||
return $this->get_parameter_from_link($url, 'p');
|
return $this->get_parameter_from_link($url, 'p');
|
||||||
|
@ -1236,7 +1236,7 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||||
self::$last_post_timestamp = time();
|
self::$last_post_timestamp = time();
|
||||||
|
|
||||||
$crawler = self::request('GET', $posting_url);
|
$crawler = self::request('GET', $posting_url);
|
||||||
$this->assertContains($this->lang($posting_contains), $crawler->filter('html')->text());
|
$this->assertStringContainsString($this->lang($posting_contains), $crawler->filter('html')->text());
|
||||||
|
|
||||||
if (!empty($form_data['upload_files']))
|
if (!empty($form_data['upload_files']))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue