From d7cb104fc14a627a2a8e980fd348f576017701a6 Mon Sep 17 00:00:00 2001 From: rxu Date: Mon, 13 Jul 2020 13:45:12 +0700 Subject: [PATCH] [ticket/16549] Move from assert[Not]Contains to assertString[Not]ContainsString PHPBB3-16549 --- tests/console/config/config_test.php | 12 +++--- tests/console/cron/cron_list_test.php | 6 +-- tests/console/cron/run_test.php | 10 ++--- tests/console/update/check_test.php | 10 ++--- tests/console/user/activate_test.php | 2 +- tests/console/user/add_test.php | 10 ++--- tests/console/user/delete_test.php | 4 +- tests/email/email_parsing_test.php | 16 +++---- tests/event/exception_listener_test.php | 2 +- tests/functional/acp_bbcodes_test.php | 8 ++-- tests/functional/acp_groups_test.php | 2 +- tests/functional/acp_permissions_test.php | 10 ++--- tests/functional/acp_users_test.php | 4 +- tests/functional/auth_test.php | 10 ++--- tests/functional/common_avatar_test_case.php | 2 +- tests/functional/common_groups_test_case.php | 12 +++--- tests/functional/download_test.php | 8 ++-- tests/functional/extension_acp_test.php | 30 ++++++------- .../functional/extension_controller_test.php | 16 +++---- .../functional/extension_global_lang_test.php | 4 +- tests/functional/extension_module_test.php | 6 +-- .../extension_permission_lang_test.php | 4 +- tests/functional/feed_test.php | 30 ++++++------- tests/functional/fileupload_form_test.php | 2 +- tests/functional/forgot_password_test.php | 2 +- tests/functional/forum_style_test.php | 24 ++++++++--- tests/functional/jumpbox_test.php | 2 +- tests/functional/mcp_test.php | 6 +-- tests/functional/memberlist_test.php | 42 +++++++++---------- tests/functional/metadata_manager_test.php | 18 ++++---- tests/functional/notification_test.php | 2 +- tests/functional/paging_test.php | 12 +++--- tests/functional/plupload_test.php | 2 +- tests/functional/posting_test.php | 24 +++++------ tests/functional/private_messages_test.php | 10 ++--- tests/functional/prune_shadow_topic_test.php | 4 +- tests/functional/report_post_captcha_test.php | 8 ++-- tests/functional/subforum_test.php | 8 ++-- tests/functional/ucp_groups_test.php | 2 +- tests/functional/user_password_reset_test.php | 10 ++--- tests/functional/viewforum_paging_test.php | 8 ++-- .../functional/visibility_disapprove_test.php | 22 +++++----- .../functional/visibility_reapprove_test.php | 34 +++++++-------- .../functional/visibility_softdelete_test.php | 34 +++++++-------- .../visibility_unapproved_posts_test.php | 42 +++++++++---------- tests/functional/visit_installer_test.php | 6 +-- tests/functions/get_remote_file_test.php | 4 +- tests/network/ftp_fsock_pasv_epsv_test.php | 2 +- .../phpbb_functional_test_case.php | 24 +++++------ 49 files changed, 292 insertions(+), 280 deletions(-) diff --git a/tests/console/config/config_test.php b/tests/console/config/config_test.php index b828be2ec4..8321680547 100644 --- a/tests/console/config/config_test.php +++ b/tests/console/config/config_test.php @@ -159,7 +159,7 @@ class phpbb_console_command_config_test extends phpbb_test_case '--no-newline' => false, )); - $this->assertContains('CLI_CONFIG_NOT_EXISTS', $command_tester->getDisplay()); + $this->assertStringContainsString('CLI_CONFIG_NOT_EXISTS', $command_tester->getDisplay()); } public function test_increment_dynamic() @@ -175,7 +175,7 @@ class phpbb_console_command_config_test extends phpbb_test_case '--dynamic' => true, )); - $this->assertContains('CLI_CONFIG_INCREMENT_SUCCESS', $command_tester->getDisplay()); + $this->assertStringContainsString('CLI_CONFIG_INCREMENT_SUCCESS', $command_tester->getDisplay()); $this->assertSame(2, $this->config['test_key']); } @@ -192,7 +192,7 @@ class phpbb_console_command_config_test extends phpbb_test_case '--dynamic' => false, )); - $this->assertContains('CLI_CONFIG_INCREMENT_SUCCESS', $command_tester->getDisplay()); + $this->assertStringContainsString('CLI_CONFIG_INCREMENT_SUCCESS', $command_tester->getDisplay()); $this->assertSame(2, $this->config['test_key']); } @@ -208,7 +208,7 @@ class phpbb_console_command_config_test extends phpbb_test_case '--dynamic' => true, )); - $this->assertContains('CLI_CONFIG_INCREMENT_SUCCESS', $command_tester->getDisplay()); + $this->assertStringContainsString('CLI_CONFIG_INCREMENT_SUCCESS', $command_tester->getDisplay()); $this->assertSame(2, $this->config['test_key']); } @@ -223,7 +223,7 @@ class phpbb_console_command_config_test extends phpbb_test_case 'key' => 'test_key', )); - $this->assertContains('CLI_CONFIG_DELETE_SUCCESS', $command_tester->getDisplay()); + $this->assertStringContainsString('CLI_CONFIG_DELETE_SUCCESS', $command_tester->getDisplay()); $this->assertEmpty($this->config); } @@ -237,7 +237,7 @@ class phpbb_console_command_config_test extends phpbb_test_case 'key' => 'wrong_key', )); - $this->assertContains('CLI_CONFIG_NOT_EXISTS', $command_tester->getDisplay()); + $this->assertStringContainsString('CLI_CONFIG_NOT_EXISTS', $command_tester->getDisplay()); $this->assertEmpty($this->config); } diff --git a/tests/console/cron/cron_list_test.php b/tests/console/cron/cron_list_test.php index aaa3e260e6..8a0c47f8de 100644 --- a/tests/console/cron/cron_list_test.php +++ b/tests/console/cron/cron_list_test.php @@ -41,19 +41,19 @@ class phpbb_console_command_cron_list_test extends phpbb_test_case public function test_no_task() { $this->initiate_test(0, 0); - $this->assertContains('CRON_NO_TASKS', $this->command_tester->getDisplay()); + $this->assertStringContainsString('CRON_NO_TASKS', $this->command_tester->getDisplay()); } public function test_only_ready() { $this->initiate_test(2, 0); - $this->assertContains('TASKS_READY command1 command2', preg_replace('/[\s*=]+/', ' ', trim($this->command_tester->getDisplay()))); + $this->assertStringContainsString('TASKS_READY command1 command2', preg_replace('/[\s*=]+/', ' ', trim($this->command_tester->getDisplay()))); } public function test_only_not_ready() { $this->initiate_test(0, 2); - $this->assertContains('TASKS_NOT_READY command1 command2', preg_replace('/[\s*=]+/', ' ', trim($this->command_tester->getDisplay()))); + $this->assertStringContainsString('TASKS_NOT_READY command1 command2', preg_replace('/[\s*=]+/', ' ', trim($this->command_tester->getDisplay()))); } public function test_both_ready() diff --git a/tests/console/cron/run_test.php b/tests/console/cron/run_test.php index cdad4c13e6..2c532d3c20 100644 --- a/tests/console/cron/run_test.php +++ b/tests/console/cron/run_test.php @@ -99,7 +99,7 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case $command_tester = $this->get_command_tester(); $exit_status = $command_tester->execute(array('command' => $this->command_name, '--verbose' => true)); - $this->assertContains('RUNNING_TASK', $command_tester->getDisplay()); + $this->assertStringContainsString('RUNNING_TASK', $command_tester->getDisplay()); $this->assertSame(true, $this->task->executed); $this->assertSame(0, $exit_status); $this->assertSame(false, $this->lock->owns_lock()); @@ -115,7 +115,7 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case $command_tester = $this->get_command_tester(); $exit_status = $command_tester->execute(array('command' => $this->command_name)); - $this->assertContains('CRON_LOCK_ERROR', $command_tester->getDisplay()); + $this->assertStringContainsString('CRON_LOCK_ERROR', $command_tester->getDisplay()); $this->assertSame(false, $this->task->executed); $this->assertSame(1, $exit_status); } @@ -209,7 +209,7 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case $command_tester = $this->get_command_tester(); $exit_status = $command_tester->execute(array('command' => $this->command_name, '--verbose' => true)); - $this->assertContains('CRON_NO_TASK', $command_tester->getDisplay()); + $this->assertStringContainsString('CRON_NO_TASK', $command_tester->getDisplay()); $this->assertSame(0, $exit_status); $this->assertSame(false, $this->lock->owns_lock()); } @@ -234,7 +234,7 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case $command_tester = $this->get_command_tester(); $exit_status = $command_tester->execute(array('command' => $this->command_name, 'name' => 'foo')); - $this->assertContains('CRON_NO_SUCH_TASK', $command_tester->getDisplay()); + $this->assertStringContainsString('CRON_NO_SUCH_TASK', $command_tester->getDisplay()); $this->assertSame(false, $this->task->executed); $this->assertSame(2, $exit_status); $this->assertSame(false, $this->lock->owns_lock()); @@ -245,7 +245,7 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case $command_tester = $this->get_command_tester(); $exit_status = $command_tester->execute(array('command' => $this->command_name, 'name' => 'phpbb_cron_task_simple', '--verbose' => true)); - $this->assertContains('RUNNING_TASK', $command_tester->getDisplay()); + $this->assertStringContainsString('RUNNING_TASK', $command_tester->getDisplay()); $this->assertSame(true, $this->task->executed); $this->assertSame(0, $exit_status); $this->assertSame(false, $this->lock->owns_lock()); diff --git a/tests/console/update/check_test.php b/tests/console/update/check_test.php index 555c9454e1..e377f247d9 100644 --- a/tests/console/update/check_test.php +++ b/tests/console/update/check_test.php @@ -43,7 +43,7 @@ class phpbb_console_command_check_test extends phpbb_test_case { $command_tester = $this->get_command_tester('100000'); $status = $command_tester->execute(array('command' => $this->command_name, '--no-ansi' => true, '--verbose' => true)); - $this->assertContains($this->language->lang('UPDATE_NOT_NEEDED'), $command_tester->getDisplay()); + $this->assertStringContainsString($this->language->lang('UPDATE_NOT_NEEDED'), $command_tester->getDisplay()); $this->assertSame($status, 0); } @@ -52,7 +52,7 @@ class phpbb_console_command_check_test extends phpbb_test_case { $command_tester = $this->get_command_tester('0'); $status = $command_tester->execute(array('command' => $this->command_name, '--no-ansi' => true)); - $this->assertContains($this->language->lang('UPDATE_NEEDED'), $command_tester->getDisplay()); + $this->assertStringContainsString($this->language->lang('UPDATE_NEEDED'), $command_tester->getDisplay()); $this->assertSame($status, 1); } @@ -60,8 +60,8 @@ class phpbb_console_command_check_test extends phpbb_test_case { $command_tester = $this->get_command_tester('0'); $status = $command_tester->execute(array('command' => $this->command_name, '--no-ansi' => true, '--verbose' => true)); - $this->assertContains($this->language->lang('UPDATE_NEEDED'), $command_tester->getDisplay()); - $this->assertContains($this->language->lang('UPDATES_AVAILABLE'), $command_tester->getDisplay()); + $this->assertStringContainsString($this->language->lang('UPDATE_NEEDED'), $command_tester->getDisplay()); + $this->assertStringContainsString($this->language->lang('UPDATES_AVAILABLE'), $command_tester->getDisplay()); $this->assertSame($status, 1); } @@ -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'); $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); } diff --git a/tests/console/user/activate_test.php b/tests/console/user/activate_test.php index 261eac152a..01f38e5ed9 100644 --- a/tests/console/user/activate_test.php +++ b/tests/console/user/activate_test.php @@ -80,6 +80,6 @@ class phpbb_console_user_activate_test extends phpbb_console_user_base '--deactivate' => $deactivate, )); - $this->assertContains($expected, $command_tester->getDisplay()); + $this->assertStringContainsString($expected, $command_tester->getDisplay()); } } diff --git a/tests/console/user/add_test.php b/tests/console/user/add_test.php index cc86cb27d3..126771c7c6 100644 --- a/tests/console/user/add_test.php +++ b/tests/console/user/add_test.php @@ -93,7 +93,7 @@ class phpbb_console_user_add_test extends phpbb_console_user_base )); $this->assertNotEquals(null, $this->get_user_id('foo')); - $this->assertContains('CLI_USER_ADD_SUCCESS', $command_tester->getDisplay()); + $this->assertStringContainsString('CLI_USER_ADD_SUCCESS', $command_tester->getDisplay()); } public function test_add_dialog() @@ -113,7 +113,7 @@ class phpbb_console_user_add_test extends phpbb_console_user_base )); $this->assertNotEquals(null, $this->get_user_id('bar')); - $this->assertContains('CLI_USER_ADD_SUCCESS', $command_tester->getDisplay()); + $this->assertStringContainsString('CLI_USER_ADD_SUCCESS', $command_tester->getDisplay()); } @@ -130,8 +130,8 @@ class phpbb_console_user_add_test extends phpbb_console_user_base '--email' => 'foo' )); - $this->assertContains('USERNAME_TAKEN', $command_tester->getDisplay()); - $this->assertContains('TOO_SHORT', $command_tester->getDisplay()); - $this->assertContains('EMAIL_INVALID', $command_tester->getDisplay()); + $this->assertStringContainsString('USERNAME_TAKEN', $command_tester->getDisplay()); + $this->assertStringContainsString('TOO_SHORT', $command_tester->getDisplay()); + $this->assertStringContainsString('EMAIL_INVALID', $command_tester->getDisplay()); } } diff --git a/tests/console/user/delete_test.php b/tests/console/user/delete_test.php index 4535c4e295..f010fc6356 100644 --- a/tests/console/user/delete_test.php +++ b/tests/console/user/delete_test.php @@ -53,7 +53,7 @@ class phpbb_console_user_delete_test extends phpbb_console_user_base )); $this->assertNull($this->get_user_id('Test')); - $this->assertContains('USER_DELETED', $command_tester->getDisplay()); + $this->assertStringContainsString('USER_DELETED', $command_tester->getDisplay()); } public function test_delete_non_user() @@ -70,7 +70,7 @@ class phpbb_console_user_delete_test extends phpbb_console_user_base '--delete-posts' => false, )); - $this->assertContains('NO_USER', $command_tester->getDisplay()); + $this->assertStringContainsString('NO_USER', $command_tester->getDisplay()); } public function test_delete_cancel() diff --git a/tests/email/email_parsing_test.php b/tests/email/email_parsing_test.php index be61d82bde..c3515c26f8 100644 --- a/tests/email/email_parsing_test.php +++ b/tests/email/email_parsing_test.php @@ -137,13 +137,13 @@ class phpbb_email_parsing_test extends phpbb_test_case $reflection_template = $this->reflection_template_property->getValue($this->messenger); $msg = trim($reflection_template->assign_display('body')); - $this->assertContains($author_name, $msg); - $this->assertContains($forum_name, $msg); - $this->assertContains($topic_title, $msg); - $this->assertContains($username, $msg); - $this->assertContains(htmlspecialchars_decode($config['sitename']), $msg); - $this->assertContains(str_replace('
', "\n", "-- \n" . htmlspecialchars_decode($config['board_email_sig'])), $msg); - $this->assertNotContains('EMAIL_SIG', $msg); - $this->assertNotContains('U_STOP_WATCHING_FORUM', $msg); + $this->assertStringContainsString($author_name, $msg); + $this->assertStringContainsString($forum_name, $msg); + $this->assertStringContainsString($topic_title, $msg); + $this->assertStringContainsString($username, $msg); + $this->assertStringContainsString(htmlspecialchars_decode($config['sitename']), $msg); + $this->assertStringContainsString(str_replace('
', "\n", "-- \n" . htmlspecialchars_decode($config['board_email_sig'])), $msg); + $this->assertStringNotContainsString('EMAIL_SIG', $msg); + $this->assertStringNotContainsString('U_STOP_WATCHING_FORUM', $msg); } } diff --git a/tests/event/exception_listener_test.php b/tests/event/exception_listener_test.php index fbae9e25b7..346bc5f3ec 100644 --- a/tests/event/exception_listener_test.php +++ b/tests/event/exception_listener_test.php @@ -94,7 +94,7 @@ class exception_listener extends phpbb_test_case if (isset($expected['content'])) { - $this->assertContains($expected['content'], $response->getContent()); + $this->assertStringContainsString($expected['content'], $response->getContent()); } } } diff --git a/tests/functional/acp_bbcodes_test.php b/tests/functional/acp_bbcodes_test.php index cc6397fdfd..bdf7920615 100644 --- a/tests/functional/acp_bbcodes_test.php +++ b/tests/functional/acp_bbcodes_test.php @@ -38,10 +38,10 @@ class phpbb_functional_acp_bbcodes_test extends phpbb_functional_test_case $crawler = self::submit($form); $html = $crawler->filter('#preview')->html(); - $this->assertContains('
a
', $html); - $this->assertContains('
b
', $html); - $this->assertContains('
c
', $html); - $this->assertContains('
d
', $html); + $this->assertStringContainsString('
a
', $html); + $this->assertStringContainsString('
b
', $html); + $this->assertStringContainsString('
c
', $html); + $this->assertStringContainsString('
d
', $html); } /** diff --git a/tests/functional/acp_groups_test.php b/tests/functional/acp_groups_test.php index 9dfdc93474..f574115d62 100644 --- a/tests/functional/acp_groups_test.php +++ b/tests/functional/acp_groups_test.php @@ -105,7 +105,7 @@ class phpbb_functional_acp_groups_test extends phpbb_functional_common_groups_te } } $crawler = self::submit($form); - $this->assertContains($this->lang('GROUP_UPDATED'), $crawler->text()); + $this->assertStringContainsString($this->lang('GROUP_UPDATED'), $crawler->text()); $form = $this->get_group_manage_form($group_id); if (!isset($tick_legend) && !isset($tick_teampage)) diff --git a/tests/functional/acp_permissions_test.php b/tests/functional/acp_permissions_test.php index 41fa03639e..36cbbf2359 100644 --- a/tests/functional/acp_permissions_test.php +++ b/tests/functional/acp_permissions_test.php @@ -31,21 +31,21 @@ class phpbb_functional_acp_permissions_test extends phpbb_functional_test_case // XXX hardcoded id $crawler = self::request('GET', 'adm/index.php?i=16&sid=' . $this->sid); // these language strings are html - $this->assertContains($this->lang('ACP_PERMISSIONS_EXPLAIN'), $this->get_content()); + $this->assertStringContainsString($this->lang('ACP_PERMISSIONS_EXPLAIN'), $this->get_content()); } public function test_select_user() { // User permissions $crawler = self::request('GET', 'adm/index.php?i=acp_permissions&icat=16&mode=setting_user_global&sid=' . $this->sid); - $this->assertContains($this->lang('ACP_USERS_PERMISSIONS_EXPLAIN'), $this->get_content()); + $this->assertStringContainsString($this->lang('ACP_USERS_PERMISSIONS_EXPLAIN'), $this->get_content()); // Select admin $form = $crawler->selectButton($this->lang('SUBMIT'))->form(); $data = array('username[0]' => 'admin'); $form->setValues($data); $crawler = self::submit($form); - $this->assertContains($this->lang('ACL_SET'), $crawler->filter('h1')->eq(1)->text()); + $this->assertStringContainsString($this->lang('ACL_SET'), $crawler->filter('h1')->eq(1)->text()); } public function permissions_data() @@ -93,7 +93,7 @@ class phpbb_functional_acp_permissions_test extends phpbb_functional_test_case { // Get the form $crawler = self::request('GET', "adm/index.php?i=acp_permissions&icat=16&mode=$mode&${object_name}[0]=$object_id&type=$permission_type&sid=" . $this->sid); - $this->assertContains($this->lang('ACL_SET'), $crawler->filter('h1')->eq(1)->text()); + $this->assertStringContainsString($this->lang('ACL_SET'), $crawler->filter('h1')->eq(1)->text()); // XXX globals for \phpbb\auth\auth, refactor it later global $db, $cache; @@ -115,7 +115,7 @@ class phpbb_functional_acp_permissions_test extends phpbb_functional_test_case $data = array("setting[$object_id][0][$permission]" => '0'); $form->setValues($data); $crawler = self::submit($form); - $this->assertContains($this->lang('AUTH_UPDATED'), $crawler->text()); + $this->assertStringContainsString($this->lang('AUTH_UPDATED'), $crawler->text()); // check acl again $auth = new \phpbb\auth\auth; diff --git a/tests/functional/acp_users_test.php b/tests/functional/acp_users_test.php index 5c10f809d6..2470b55f06 100644 --- a/tests/functional/acp_users_test.php +++ b/tests/functional/acp_users_test.php @@ -34,7 +34,7 @@ class phpbb_functional_acp_users_test extends phpbb_functional_test_case $crawler = self::request('GET', "adm/index.php?i=users&mode=overview&u=$user_id&sid={$this->sid}"); $form = $crawler->filter('#user_delete')->selectButton($this->lang('SUBMIT'))->form(); $crawler = self::submit($form); - $this->assertContains($this->lang('CANNOT_REMOVE_FOUNDER'), $this->get_content()); + $this->assertStringContainsString($this->lang('CANNOT_REMOVE_FOUNDER'), $this->get_content()); } protected function make_founder($user_id) @@ -44,6 +44,6 @@ class phpbb_functional_acp_users_test extends phpbb_functional_test_case $data = array('user_founder' => '1'); $form->setValues($data); $crawler = self::submit($form); - $this->assertContains($this->lang('USER_OVERVIEW_UPDATED'), $this->get_content()); + $this->assertStringContainsString($this->lang('USER_OVERVIEW_UPDATED'), $this->get_content()); } } diff --git a/tests/functional/auth_test.php b/tests/functional/auth_test.php index 76e1709afb..3e22a5b651 100644 --- a/tests/functional/auth_test.php +++ b/tests/functional/auth_test.php @@ -22,7 +22,7 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case // check for logout link $crawler = self::request('GET', 'index.php'); - $this->assertContains($this->lang('LOGOUT', 'admin'), $crawler->filter('.navbar')->text()); + $this->assertStringContainsString($this->lang('LOGOUT', 'admin'), $crawler->filter('.navbar')->text()); } public function test_login_other() @@ -30,7 +30,7 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case $this->create_user('anothertestuser'); $this->login('anothertestuser'); $crawler = self::request('GET', 'index.php'); - $this->assertContains('anothertestuser', $crawler->filter('#username_logged_in')->text()); + $this->assertStringContainsString('anothertestuser', $crawler->filter('#username_logged_in')->text()); } /** @@ -46,7 +46,7 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case $config['auth_method'] = 'foobar'; $this->login('anothertestuser'); $crawler = self::request('GET', 'index.php'); - $this->assertContains('anothertestuser', $crawler->filter('#username_logged_in')->text()); + $this->assertStringContainsString('anothertestuser', $crawler->filter('#username_logged_in')->text()); $sql = 'UPDATE ' . CONFIG_TABLE . " SET config_value = 'db' WHERE config_name = 'auth_method'"; $db->sql_query($sql); $config['auth_method'] = 'db'; @@ -65,7 +65,7 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case // look for a register link, which should be visible only when logged out $crawler = self::request('GET', 'index.php'); - $this->assertContains($this->lang('REGISTER'), $crawler->filter('.navbar')->text()); + $this->assertStringContainsString($this->lang('REGISTER'), $crawler->filter('.navbar')->text()); } public function test_acp_login() @@ -75,6 +75,6 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case // check that we are logged in $crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid); - $this->assertContains($this->lang('ADMIN_PANEL'), $crawler->filter('h1')->text()); + $this->assertStringContainsString($this->lang('ADMIN_PANEL'), $crawler->filter('h1')->text()); } } diff --git a/tests/functional/common_avatar_test_case.php b/tests/functional/common_avatar_test_case.php index 36987a0c45..0ead7f9f24 100644 --- a/tests/functional/common_avatar_test_case.php +++ b/tests/functional/common_avatar_test_case.php @@ -83,7 +83,7 @@ abstract class phpbb_functional_common_avatar_test_case extends phpbb_functional } catch (Exception $e) { - $this->assertContains($expected, $crawler->text()); + $this->assertStringContainsString($expected, $crawler->text()); } if ($delete) diff --git a/tests/functional/common_groups_test_case.php b/tests/functional/common_groups_test_case.php index 521b7c84d2..fdca908239 100644 --- a/tests/functional/common_groups_test_case.php +++ b/tests/functional/common_groups_test_case.php @@ -47,9 +47,9 @@ abstract class phpbb_functional_common_groups_test_case extends phpbb_functional $crawler = self::request('GET', 'adm/index.php?i=board&mode=avatar&sid=' . $this->sid); // Check the default entries we should have - $this->assertContains($this->lang('ALLOW_REMOTE_UPLOAD'), $crawler->text()); - $this->assertContains($this->lang('ALLOW_AVATARS'), $crawler->text()); - $this->assertContains($this->lang('ALLOW_LOCAL'), $crawler->text()); + $this->assertStringContainsString($this->lang('ALLOW_REMOTE_UPLOAD'), $crawler->text()); + $this->assertStringContainsString($this->lang('ALLOW_AVATARS'), $crawler->text()); + $this->assertStringContainsString($this->lang('ALLOW_LOCAL'), $crawler->text()); // Now start setting the needed settings $form = $crawler->selectButton($this->lang('SUBMIT'))->form(); @@ -57,7 +57,7 @@ abstract class phpbb_functional_common_groups_test_case extends phpbb_functional $form['config[allow_avatar_remote]']->select(1); $form['config[allow_avatar_remote_upload]']->select(1); $crawler = self::submit($form); - $this->assertContains($this->lang('CONFIG_UPDATED'), $crawler->text()); + $this->assertStringContainsString($this->lang('CONFIG_UPDATED'), $crawler->text()); } public function groups_manage_test_data() @@ -82,7 +82,7 @@ abstract class phpbb_functional_common_groups_test_case extends phpbb_functional $form = $this->get_group_manage_form(); $form['group_colour']->setValue($input); $crawler = self::submit($form); - $this->assertContains($this->lang($expected), $crawler->text()); + $this->assertStringContainsString($this->lang($expected), $crawler->text()); } public function group_avatar_min_max_data() @@ -112,6 +112,6 @@ abstract class phpbb_functional_common_groups_test_case extends phpbb_functional $form['avatar_driver']->setValue($avatar_type); $form[$form_name]->setValue($input); $crawler = self::submit($form); - $this->assertContains($this->lang($expected), $crawler->text()); + $this->assertStringContainsString($this->lang($expected), $crawler->text()); } } diff --git a/tests/functional/download_test.php b/tests/functional/download_test.php index 3d4f316d72..6b58a9fff4 100644 --- a/tests/functional/download_test.php +++ b/tests/functional/download_test.php @@ -49,7 +49,7 @@ class phpbb_functional_download_test extends phpbb_functional_test_case $post = $this->create_topic($this->data['forums']['Download #1'], 'Download Topic #1', 'This is a test topic posted by the testing framework.', array('upload_files' => 1)); $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}"); - $this->assertContains('Download Topic #1', $crawler->filter('html')->text()); + $this->assertStringContainsString('Download Topic #1', $crawler->filter('html')->text()); $this->data['topics']['Download Topic #1'] = (int) $post['topic_id']; $this->data['posts']['Download Topic #1'] = (int) $this->get_parameter_from_link($crawler->filter('.post')->selectLink($this->lang('POST', '', ''))->link()->getUri(), 'p'); @@ -57,7 +57,7 @@ class phpbb_functional_download_test extends phpbb_functional_test_case $post2 = $this->create_post($this->data['forums']['Download #1'], $post['topic_id'], 'Re: Download Topic #1-#2', 'This is a test post posted by the testing framework.', array('upload_files' => 1)); $crawler = self::request('GET', "viewtopic.php?p={$post2['post_id']}&sid={$this->sid}"); - $this->assertContains('Re: Download Topic #1-#2', $crawler->filter('html')->text()); + $this->assertStringContainsString('Re: Download Topic #1-#2', $crawler->filter('html')->text()); $this->data['posts']['Re: Download Topic #1-#2'] = (int) $post2['post_id']; } @@ -115,7 +115,7 @@ class phpbb_functional_download_test extends phpbb_functional_test_case $this->assertContainsLang('POST_DELETED', $crawler->text()); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Download Topic #1']}&sid={$this->sid}"); - $this->assertContains($this->lang('POST_DISPLAY', '', ''), $crawler->text()); + $this->assertStringContainsString($this->lang('POST_DISPLAY', '', ''), $crawler->text()); } public function test_download_softdeleted_post() @@ -182,7 +182,7 @@ class phpbb_functional_download_test extends phpbb_functional_test_case $this->assertContainsLang('TOPIC_DELETED_SUCCESS', $crawler->text()); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Download Topic #1']}&sid={$this->sid}"); - $this->assertContains('Download Topic #1', $crawler->filter('h2')->text()); + $this->assertStringContainsString('Download Topic #1', $crawler->filter('h2')->text()); } public function test_download_softdeleted_topic() diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index 1e6cd955d8..1c937b106b 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -88,27 +88,27 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case $this->assertCount(1, $crawler->filter('.ext_enabled')); $this->assertCount(7, $crawler->filter('.ext_disabled')); - $this->assertContains('phpBB Foo Extension', $crawler->filter('.ext_enabled')->eq(0)->text()); + $this->assertStringContainsString('phpBB Foo Extension', $crawler->filter('.ext_enabled')->eq(0)->text()); $this->assertContainsLang('EXTENSION_DISABLE', $crawler->filter('.ext_enabled')->eq(0)->text()); - $this->assertContains('phpBB Moo Extension', $crawler->filter('.ext_disabled')->eq(2)->text()); + $this->assertStringContainsString('phpBB Moo Extension', $crawler->filter('.ext_disabled')->eq(2)->text()); $this->assertContainsLang('DETAILS', $crawler->filter('.ext_disabled')->eq(2)->text()); $this->assertContainsLang('EXTENSION_ENABLE', $crawler->filter('.ext_disabled')->eq(2)->text()); $this->assertContainsLang('EXTENSION_DELETE_DATA', $crawler->filter('.ext_disabled')->eq(2)->text()); - $this->assertContains('The “vendor/test2” extension is not valid.', $crawler->filter('.ext_disabled')->eq(0)->text()); + $this->assertStringContainsString('The “vendor/test2” extension is not valid.', $crawler->filter('.ext_disabled')->eq(0)->text()); - $this->assertContains('The “vendor/test3” extension is not valid.', $crawler->filter('.ext_disabled')->eq(1)->text()); + $this->assertStringContainsString('The “vendor/test3” extension is not valid.', $crawler->filter('.ext_disabled')->eq(1)->text()); - $this->assertContains('phpBB Bar Extension', $crawler->filter('.ext_disabled')->eq(3)->text()); + $this->assertStringContainsString('phpBB Bar Extension', $crawler->filter('.ext_disabled')->eq(3)->text()); $this->assertContainsLang('DETAILS', $crawler->filter('.ext_disabled')->eq(3)->text()); $this->assertContainsLang('EXTENSION_ENABLE', $crawler->filter('.ext_disabled')->eq(3)->text()); // Check that invalid extensions are not listed. - $this->assertNotContains('phpBB BarFoo Extension', $crawler->filter('.table1')->text()); - $this->assertNotContains('barfoo', $crawler->filter('.table1')->text()); + $this->assertStringNotContainsString('phpBB BarFoo Extension', $crawler->filter('.table1')->text()); + $this->assertStringNotContainsString('barfoo', $crawler->filter('.table1')->text()); - $this->assertNotContains('vendor3/bar', $crawler->filter('.table1')->text()); + $this->assertStringNotContainsString('vendor3/bar', $crawler->filter('.table1')->text()); } public function test_details() @@ -143,7 +143,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case { $match = true; - $this->assertContains($expected, $text); + $this->assertStringContainsString($expected, $text); } } @@ -163,7 +163,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case $this->assertContainsLang('EXTENSION_ACTIONS', $crawler->filter('div.main thead')->text()); $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid); - $this->assertContains($this->lang('EXTENSION_ENABLE_CONFIRM', 'phpBB Moo Extension'), $crawler->filter('#main')->text()); + $this->assertStringContainsString($this->lang('EXTENSION_ENABLE_CONFIRM', 'phpBB Moo Extension'), $crawler->filter('#main')->text()); // Correctly submit the enable form, default not enableable message $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=vendor3%2Ffoo&sid=' . $this->sid); @@ -171,8 +171,8 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case // Custom reason messages returned by not enableable extension $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=vendor5%2Ffoo&sid=' . $this->sid); - $this->assertContains('Reason 1', $crawler->filter('.errorbox')->text()); - $this->assertContains('Reason 2', $crawler->filter('.errorbox')->text()); + $this->assertStringContainsString('Reason 1', $crawler->filter('.errorbox')->text()); + $this->assertStringContainsString('Reason 2', $crawler->filter('.errorbox')->text()); } public function test_disable_pre() @@ -184,14 +184,14 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case $this->assertContainsLang('EXTENSION_ACTIONS', $crawler->filter('div.main thead')->text()); $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable_pre&ext_name=vendor2%2Ffoo&sid=' . $this->sid); - $this->assertContains($this->lang('EXTENSION_DISABLE_CONFIRM', 'phpBB Foo Extension'), $crawler->filter('#main')->text()); + $this->assertStringContainsString($this->lang('EXTENSION_DISABLE_CONFIRM', 'phpBB Foo Extension'), $crawler->filter('#main')->text()); } public function test_delete_data_pre() { // test2 is not available (error) $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=test2&sid=' . $this->sid); - $this->assertContains($this->lang('FILE_NOT_FOUND', ''), $crawler->filter('.errorbox')->text()); + $this->assertStringContainsString($this->lang('FILE_NOT_FOUND', ''), $crawler->filter('.errorbox')->text()); // foo is not disabled (redirect to list) $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=vendor2%2Ffoo&sid=' . $this->sid); @@ -200,7 +200,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case $this->assertContainsLang('EXTENSION_ACTIONS', $crawler->filter('div.main thead')->text()); $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid); - $this->assertContains('Are you sure that you wish to delete the data associated with “phpBB Moo Extension”?', $crawler->filter('.errorbox')->text()); + $this->assertStringContainsString('Are you sure that you wish to delete the data associated with “phpBB Moo Extension”?', $crawler->filter('.errorbox')->text()); } public function test_actions() diff --git a/tests/functional/extension_controller_test.php b/tests/functional/extension_controller_test.php index 92a9d2af6d..d680ebe92a 100644 --- a/tests/functional/extension_controller_test.php +++ b/tests/functional/extension_controller_test.php @@ -62,7 +62,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c $this->phpbb_extension_manager->enable('foo/bar'); $crawler = self::request('GET', 'app.php/foo/bar', array(), false); self::assert_response_status_code(); - $this->assertContains("foo/bar controller handle() method", $crawler->filter('body')->text()); + $this->assertStringContainsString("foo/bar controller handle() method", $crawler->filter('body')->text()); $this->phpbb_extension_manager->purge('foo/bar'); } @@ -74,7 +74,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c $this->phpbb_extension_manager->enable('foo/foo'); $crawler = self::request('GET', 'app.php/foo/foo', array(), false); self::assert_response_status_code(); - $this->assertContains("foo/foo controller handle() method", $crawler->filter('body')->text()); + $this->assertStringContainsString("foo/foo controller handle() method", $crawler->filter('body')->text()); $this->phpbb_extension_manager->purge('foo/foo'); } @@ -85,7 +85,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c { $this->phpbb_extension_manager->enable('foo/bar'); $crawler = self::request('GET', 'app.php/foo/template'); - $this->assertContains("I am a variable", $crawler->filter('#content')->text()); + $this->assertStringContainsString("I am a variable", $crawler->filter('#content')->text()); $this->phpbb_extension_manager->purge('foo/bar'); } @@ -95,7 +95,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c public function test_controller_template_include_js_css() { $crawler = self::request('GET', 'app.php/help/faq'); - $this->assertContains("./../../assets/javascript/core.js", $crawler->filter('body')->html()); + $this->assertStringContainsString("./../../assets/javascript/core.js", $crawler->filter('body')->html()); } /** @@ -107,7 +107,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c $this->phpbb_extension_manager->enable('foo/bar'); $crawler = self::request('GET', 'app.php/foo/baz', array(), false); $this->assert_response_html(500); - $this->assertContains('Missing value for argument #1: test in class foo\bar\controller\controller:baz', $crawler->filter('body')->text()); + $this->assertStringContainsString('Missing value for argument #1: test in class foo\bar\controller\controller:baz', $crawler->filter('body')->text()); $this->phpbb_extension_manager->purge('foo/bar'); } @@ -119,7 +119,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c $this->phpbb_extension_manager->enable('foo/bar'); $crawler = self::request('GET', 'app.php/foo/exception', array(), false); $this->assert_response_html(500); - $this->assertContains('Exception thrown from foo/exception route', $crawler->filter('body')->text()); + $this->assertStringContainsString('Exception thrown from foo/exception route', $crawler->filter('body')->text()); $this->phpbb_extension_manager->purge('foo/bar'); } @@ -136,7 +136,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c { $crawler = self::request('GET', 'app.php/does/not/exist', array(), false); $this->assert_response_html(404); - $this->assertContains('No route found for "GET /does/not/exist"', $crawler->filter('body')->text()); + $this->assertStringContainsString('No route found for "GET /does/not/exist"', $crawler->filter('body')->text()); } /** @@ -157,7 +157,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c $this->assertStringStartsWith('./app.php/foo/login_redirect', $form->get('redirect')->getValue()); $crawler = self::submit($form); - $this->assertContains("I am a variable", $crawler->filter('#content')->text(), 'Unsuccessful redirect after using login_box()'); + $this->assertStringContainsString("I am a variable", $crawler->filter('#content')->text(), 'Unsuccessful redirect after using login_box()'); $this->phpbb_extension_manager->purge('foo/bar'); } diff --git a/tests/functional/extension_global_lang_test.php b/tests/functional/extension_global_lang_test.php index 248f05e220..a90a769f0d 100644 --- a/tests/functional/extension_global_lang_test.php +++ b/tests/functional/extension_global_lang_test.php @@ -67,9 +67,9 @@ class phpbb_functional_extension_global_lang_test extends phpbb_functional_test_ $crawler = self::request('GET', 'index.php'); // language from language/en/common.php - $this->assertNotContains('Skip to content', $crawler->filter('.skiplink')->text()); + $this->assertStringNotContainsString('Skip to content', $crawler->filter('.skiplink')->text()); // language from ext/foo/bar/language/en/foo_global.php - $this->assertContains('Overwritten by foo', $crawler->filter('.skiplink')->text()); + $this->assertStringContainsString('Overwritten by foo', $crawler->filter('.skiplink')->text()); } } diff --git a/tests/functional/extension_module_test.php b/tests/functional/extension_module_test.php index fa7bc63a69..fc617b168b 100644 --- a/tests/functional/extension_module_test.php +++ b/tests/functional/extension_module_test.php @@ -118,7 +118,7 @@ class phpbb_functional_extension_module_test extends phpbb_functional_test_case $this->admin_login(); $crawler = self::request('GET', 'adm/index.php?i=foo%5cbar%5cacp%5cmain_module&mode=mode&sid=' . $this->sid); - $this->assertContains('Bertie rulez!', $crawler->filter('#main')->text()); + $this->assertStringContainsString('Bertie rulez!', $crawler->filter('#main')->text()); } public function test_ucp() @@ -126,11 +126,11 @@ class phpbb_functional_extension_module_test extends phpbb_functional_test_case $this->login(); $crawler = self::request('GET', 'ucp.php?sid=' . $this->sid); - $this->assertContains('UCP_FOOBAR_TITLE', $crawler->filter('#tabs')->text()); + $this->assertStringContainsString('UCP_FOOBAR_TITLE', $crawler->filter('#tabs')->text()); $link = $crawler->selectLink('UCP_FOOBAR_TITLE')->link()->getUri(); $crawler = self::request('GET', substr($link, strpos($link, 'ucp.'))); - $this->assertContains('UCP Extension Template Test Passed!', $crawler->filter('#content')->text()); + $this->assertStringContainsString('UCP Extension Template Test Passed!', $crawler->filter('#content')->text()); $this->phpbb_extension_manager->purge('foo/bar'); } diff --git a/tests/functional/extension_permission_lang_test.php b/tests/functional/extension_permission_lang_test.php index 52bed0a64b..498bb90668 100644 --- a/tests/functional/extension_permission_lang_test.php +++ b/tests/functional/extension_permission_lang_test.php @@ -78,9 +78,9 @@ class phpbb_functional_extension_permission_lang_test extends phpbb_functional_t $crawler = self::submit($form); // language from language/en/acp/permissions_phpbb.php - $this->assertContains('Can attach files', $crawler->filter('body')->text()); + $this->assertStringContainsString('Can attach files', $crawler->filter('body')->text()); // language from ext/foo/bar/language/en/permissions_foo.php - $this->assertContains('Can view foobar', $crawler->filter('body')->text()); + $this->assertStringContainsString('Can view foobar', $crawler->filter('body')->text()); } } diff --git a/tests/functional/feed_test.php b/tests/functional/feed_test.php index bf871ec02a..98736223a8 100644 --- a/tests/functional/feed_test.php +++ b/tests/functional/feed_test.php @@ -74,7 +74,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case $this->add_lang('acp/permissions'); $crawler = self::request('GET', "adm/index.php?i=acp_permissions&sid={$this->sid}&icat=16&mode=setting_group_global&group_id[0]=1"); - self::assertContains($this->lang('ACL_SET'), $crawler->filter('h1')->eq(1)->text()); + self::assertStringContainsString($this->lang('ACL_SET'), $crawler->filter('h1')->eq(1)->text()); $form = $crawler->selectButton($this->lang('APPLY_PERMISSIONS'))->form(); $form['setting[1][0][u_download]']->select(-1); @@ -338,7 +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.'); $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}"); - self::assertContains('Feeds #news - Topic #2', $crawler->filter('html')->text()); + self::assertStringContainsString('Feeds #news - Topic #2', $crawler->filter('html')->text()); $this->data['topics']['Feeds #news - Topic #2'] = (int) $post['topic_id']; $this->data['posts']['Feeds #news - Topic #2'] = (int) $this->get_parameter_from_link($crawler->filter('.post')->selectLink($this->lang('POST', '', ''))->link()->getUri(), 'p'); @@ -346,7 +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.'); $crawler = self::request('GET', "viewtopic.php?p={$post2['post_id']}&sid={$this->sid}"); - self::assertContains('Re: Feeds #news - Topic #2', $crawler->filter('html')->text()); + self::assertStringContainsString('Re: Feeds #news - Topic #2', $crawler->filter('html')->text()); $this->data['posts']['Re: Feeds #news - Topic #2'] = (int) $post2['post_id']; } @@ -502,7 +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.'); $crawler = self::request('GET', "viewtopic.php?p={$post2['post_id']}&sid={$this->sid}"); - self::assertContains('Re: Feeds #1 - Topic #2', $crawler->filter('html')->text()); + self::assertStringContainsString('Re: Feeds #1 - Topic #2', $crawler->filter('html')->text()); $this->data['posts']['Re: Feeds #1 - Topic #2'] = (int) $post2['post_id']; } @@ -530,7 +530,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case self::assertContainsLang('POST_DELETED', $crawler->text()); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Feeds #1 - Topic #2']}&sid={$this->sid}"); - self::assertContains($this->lang('POST_DISPLAY', '', ''), $crawler->text()); + self::assertStringContainsString($this->lang('POST_DISPLAY', '', ''), $crawler->text()); } public function test_feeds_softdeleted_post_admin() @@ -630,7 +630,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case self::assertContainsLang('TOPIC_DELETED_SUCCESS', $crawler->text()); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Feeds #1 - Topic #2']}&sid={$this->sid}"); - self::assertContains('Feeds #1 - Topic #2', $crawler->filter('h2')->text()); + self::assertStringContainsString('Feeds #1 - Topic #2', $crawler->filter('h2')->text()); } public function test_feeds_softdeleted_topic_admin() @@ -769,7 +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'); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Feeds #1.1 - Topic #2']}&sid={$this->sid}"); - self::assertNotContains('Re: Feeds #1.1 - Topic #2', $crawler->filter('html')->text()); + self::assertStringNotContainsString('Re: Feeds #1.1 - Topic #2', $crawler->filter('html')->text()); } public function test_feeds_unapproved_post_admin() @@ -860,7 +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'); $crawler = self::request('GET', "viewforum.php?f={$this->data['forums']['Feeds #1.1']}&sid={$this->sid}"); - self::assertNotContains('Feeds #1.1 - Topic #3', $crawler->filter('html')->text()); + self::assertStringNotContainsString('Feeds #1.1 - Topic #3', $crawler->filter('html')->text()); $this->logout(); $this->set_flood_interval(15); @@ -1012,7 +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)); $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}"); - self::assertContains('Feeds #1 - Topic #3', $crawler->filter('html')->text()); + self::assertStringContainsString('Feeds #1 - Topic #3', $crawler->filter('html')->text()); $this->data['topics']['Feeds #1 - Topic #3'] = (int) $post['topic_id']; } @@ -1230,7 +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]'); $crawler = self::request('GET', "viewtopic.php?p={$post2['post_id']}&sid={$this->sid}"); - self::assertContains('Re: Feeds #1 - Topic #3-1', $crawler->filter('html')->text()); + self::assertStringContainsString('Re: Feeds #1 - Topic #3-1', $crawler->filter('html')->text()); $this->data['posts']['Re: Feeds #1 - Topic #3-1'] = (int) $post2['post_id']; } @@ -1395,7 +1395,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case foreach($data['contents'] as $entry_id => $string) { $content = $crawler->filterXPath("//entry[{$entry_id}]/content")->text(); - self::assertContains($string, $content, "Tested feed : 'app.php/feed{$params}'"); + self::assertStringContainsString($string, $content, "Tested feed : 'app.php/feed{$params}'"); } } @@ -1420,13 +1420,13 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case if ($attachment['displayed']) { - self::assertContains($url, $content, "Tested feed : 'app.php/feed{$params}'"); - self::assertNotContains($string, $content, "Tested feed : 'app.php/feed{$params}'"); + self::assertStringContainsString($url, $content, "Tested feed : 'app.php/feed{$params}'"); + self::assertStringNotContainsString($string, $content, "Tested feed : 'app.php/feed{$params}'"); } else { - self::assertContains($string, $content, "Tested feed : 'app.php/feed{$params}'"); - self::assertNotContains($url, $content, "Tested feed : 'app.php/feed{$params}'"); + self::assertStringContainsString($string, $content, "Tested feed : 'app.php/feed{$params}'"); + self::assertStringNotContainsString($url, $content, "Tested feed : 'app.php/feed{$params}'"); } } } diff --git a/tests/functional/fileupload_form_test.php b/tests/functional/fileupload_form_test.php index a08ec4ee43..e81c0b6e1e 100644 --- a/tests/functional/fileupload_form_test.php +++ b/tests/functional/fileupload_form_test.php @@ -143,7 +143,7 @@ class phpbb_functional_fileupload_form_test extends phpbb_functional_test_case $crawler = $this->upload_file('valid.jpg', 'image/jpeg'); // Ensure there was no error message rendered - $this->assertNotContains('

' . $this->lang('INFORMATION') . '

', $this->get_content()); + $this->assertStringNotContainsString('

' . $this->lang('INFORMATION') . '

', $this->get_content()); // Also the file name should be in the first row of the files table $this->assertEquals('valid.jpg', $crawler->filter('span.file-name')->eq(1)->text()); diff --git a/tests/functional/forgot_password_test.php b/tests/functional/forgot_password_test.php index b5309aa5be..554b503470 100644 --- a/tests/functional/forgot_password_test.php +++ b/tests/functional/forgot_password_test.php @@ -40,7 +40,7 @@ class phpbb_functional_forgot_password_test extends phpbb_functional_test_case $this->logout(); $crawler = self::request('GET', 'app.php/user/forgot_password'); - $this->assertContains($this->lang('UCP_PASSWORD_RESET_DISABLED', '', ''), $crawler->text()); + $this->assertStringContainsString($this->lang('UCP_PASSWORD_RESET_DISABLED', '', ''), $crawler->text()); } diff --git a/tests/functional/forum_style_test.php b/tests/functional/forum_style_test.php index 0f969cd602..cdbd53146a 100644 --- a/tests/functional/forum_style_test.php +++ b/tests/functional/forum_style_test.php @@ -16,16 +16,28 @@ */ class phpbb_functional_forum_style_test extends phpbb_functional_test_case { + public function test_font_awesome_style() + { + $crawler = self::request('GET', 'viewtopic.php?t=1&f=2'); + $this->assertStringContainsString('font-awesome.min', $crawler->filter('head > link[rel=stylesheet]')->eq(0)->attr('href')); + + $crawler = self::request('GET', 'viewtopic.php?t=1'); + $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'); + $this->assertStringContainsString('font-awesome.min', $crawler->filter('head > link[rel=stylesheet]')->eq(0)->attr('href')); + } + public function test_default_forum_style() { $crawler = self::request('GET', 'viewtopic.php?t=1&f=2'); - $this->assertContains('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href')); + $this->assertStringContainsString('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->eq(2)->attr('href')); $crawler = self::request('GET', 'viewtopic.php?t=1'); - $this->assertContains('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href')); + $this->assertStringContainsString('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->eq(2)->attr('href')); $crawler = self::request('GET', 'viewtopic.php?t=1&view=next'); - $this->assertContains('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href')); + $this->assertStringContainsString('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->eq(2)->attr('href')); } public function test_custom_forum_style() @@ -35,13 +47,13 @@ class phpbb_functional_forum_style_test extends phpbb_functional_test_case $db->sql_query('UPDATE ' . FORUMS_TABLE . ' SET forum_style = 2 WHERE forum_id = 2'); $crawler = self::request('GET', 'viewtopic.php?t=1&f=2'); - $this->assertContains('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href')); + $this->assertStringContainsString('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->eq(2)->attr('href')); $crawler = self::request('GET', 'viewtopic.php?t=1'); - $this->assertContains('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href')); + $this->assertStringContainsString('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->eq(2)->attr('href')); $crawler = self::request('GET', 'viewtopic.php?t=1&view=next'); - $this->assertContains('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href')); + $this->assertStringContainsString('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->eq(2)->attr('href')); $db->sql_query('UPDATE ' . FORUMS_TABLE . ' SET forum_style = 0 WHERE forum_id = 2'); $this->delete_style(2, 'test_style'); diff --git a/tests/functional/jumpbox_test.php b/tests/functional/jumpbox_test.php index f5a671b1b9..9e2938f9e2 100644 --- a/tests/functional/jumpbox_test.php +++ b/tests/functional/jumpbox_test.php @@ -30,6 +30,6 @@ class phpbb_functional_jumpbox_test extends phpbb_functional_test_case protected function check_valid_jump($forum) { - $this->assertContains($this->lang('FORUM') . ": $forum", $this->crawler->filter('#cp-main h2')->text(), $this->crawler->text()); + $this->assertStringContainsString($this->lang('FORUM') . ": $forum", $this->crawler->filter('#cp-main h2')->text(), $this->crawler->text()); } } diff --git a/tests/functional/mcp_test.php b/tests/functional/mcp_test.php index 40615d66a5..87a98dae74 100644 --- a/tests/functional/mcp_test.php +++ b/tests/functional/mcp_test.php @@ -24,7 +24,7 @@ class phpbb_functional_mcp_test extends phpbb_functional_test_case $post = $this->create_topic(2, 'Test Topic 2', 'Testing move post with "Move posts" option from Quick-Moderator Tools.'); $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}"); - $this->assertContains('Testing move post with "Move posts" option from Quick-Moderator Tools.', $crawler->filter('html')->text()); + $this->assertStringContainsString('Testing move post with "Move posts" option from Quick-Moderator Tools.', $crawler->filter('html')->text()); return $crawler; } @@ -49,7 +49,7 @@ class phpbb_functional_mcp_test extends phpbb_functional_test_case )); $form['post_id_list'][0]->tick(); $crawler = self::submit($form); - $this->assertContains($this->lang('MERGE_POSTS'), $crawler->filter('html')->text()); + $this->assertStringContainsString($this->lang('MERGE_POSTS'), $crawler->filter('html')->text()); return $crawler; } @@ -62,7 +62,7 @@ class phpbb_functional_mcp_test extends phpbb_functional_test_case $this->add_lang('mcp'); $form = $crawler->selectButton('Yes')->form(); $crawler = self::submit($form); - $this->assertContains($this->lang('POSTS_MERGED_SUCCESS'), $crawler->text()); + $this->assertStringContainsString($this->lang('POSTS_MERGED_SUCCESS'), $crawler->text()); } public function test_delete_logs() diff --git a/tests/functional/memberlist_test.php b/tests/functional/memberlist_test.php index 1da5c39401..3e40ddc528 100644 --- a/tests/functional/memberlist_test.php +++ b/tests/functional/memberlist_test.php @@ -22,15 +22,15 @@ class phpbb_functional_memberlist_test extends phpbb_functional_test_case // logs in as admin $this->login(); $crawler = self::request('GET', 'memberlist.php?sid=' . $this->sid); - $this->assertContains('memberlist-test-user', $crawler->text()); + $this->assertStringContainsString('memberlist-test-user', $crawler->text()); // restrict by first character $crawler = self::request('GET', 'memberlist.php?first_char=m&sid=' . $this->sid); - $this->assertContains('memberlist-test-user', $crawler->text()); + $this->assertStringContainsString('memberlist-test-user', $crawler->text()); // make sure results for wrong character are not returned $crawler = self::request('GET', 'memberlist.php?first_char=a&sid=' . $this->sid); - $this->assertNotContains('memberlist-test-user', $crawler->text()); + $this->assertStringNotContainsString('memberlist-test-user', $crawler->text()); } public function test_viewprofile() @@ -38,7 +38,7 @@ class phpbb_functional_memberlist_test extends phpbb_functional_test_case $this->login(); // XXX hardcoded user id $crawler = self::request('GET', 'memberlist.php?mode=viewprofile&u=2&sid=' . $this->sid); - $this->assertContains('admin', $crawler->filter('h2')->text()); + $this->assertStringContainsString('admin', $crawler->filter('h2')->text()); } protected function get_memberlist_leaders_table_crawler() @@ -55,16 +55,16 @@ class phpbb_functional_memberlist_test extends phpbb_functional_test_case $crawler = $this->get_memberlist_leaders_table_crawler(); // Admin in admin group, but not in moderators - $this->assertContains('admin', $crawler->eq(0)->text()); - $this->assertNotContains('admin', $crawler->eq(1)->text()); + $this->assertStringContainsString('admin', $crawler->eq(0)->text()); + $this->assertStringNotContainsString('admin', $crawler->eq(1)->text()); // memberlist-test-user in neither group - $this->assertNotContains('memberlist-test-user', $crawler->eq(0)->text()); - $this->assertNotContains('memberlist-test-user', $crawler->eq(1)->text()); + $this->assertStringNotContainsString('memberlist-test-user', $crawler->eq(0)->text()); + $this->assertStringNotContainsString('memberlist-test-user', $crawler->eq(1)->text()); // memberlist-test-moderator in neither group - $this->assertNotContains('memberlist-test-moderator', $crawler->eq(0)->text()); - $this->assertNotContains('memberlist-test-moderator', $crawler->eq(1)->text()); + $this->assertStringNotContainsString('memberlist-test-moderator', $crawler->eq(0)->text()); + $this->assertStringNotContainsString('memberlist-test-moderator', $crawler->eq(1)->text()); } public function test_leaders_remove_users() @@ -74,14 +74,14 @@ class phpbb_functional_memberlist_test extends phpbb_functional_test_case // Remove admin from admins, but is now in moderators $this->remove_user_group('ADMINISTRATORS', array('admin')); $crawler = $this->get_memberlist_leaders_table_crawler(); - $this->assertNotContains('admin', $crawler->eq(0)->text()); - $this->assertContains('admin', $crawler->eq(1)->text()); + $this->assertStringNotContainsString('admin', $crawler->eq(0)->text()); + $this->assertStringContainsString('admin', $crawler->eq(1)->text()); // Remove admin from moderators, should not be visible anymore $this->remove_user_group('GLOBAL_MODERATORS', array('admin')); $crawler = $this->get_memberlist_leaders_table_crawler(); - $this->assertNotContains('admin', $crawler->eq(0)->text()); - $this->assertNotContains('admin', $crawler->eq(1)->text()); + $this->assertStringNotContainsString('admin', $crawler->eq(0)->text()); + $this->assertStringNotContainsString('admin', $crawler->eq(1)->text()); } public function test_leaders_add_users() @@ -91,20 +91,20 @@ class phpbb_functional_memberlist_test extends phpbb_functional_test_case // Add memberlist-test-moderator to moderators $this->add_user_group('GLOBAL_MODERATORS', array('memberlist-test-moderator')); $crawler = $this->get_memberlist_leaders_table_crawler(); - $this->assertNotContains('memberlist-test-moderator', $crawler->eq(0)->text()); - $this->assertContains('memberlist-test-moderator', $crawler->eq(1)->text()); + $this->assertStringNotContainsString('memberlist-test-moderator', $crawler->eq(0)->text()); + $this->assertStringContainsString('memberlist-test-moderator', $crawler->eq(1)->text()); // Add admin to moderators, should be visible as moderator $this->add_user_group('GLOBAL_MODERATORS', array('admin'), true); $crawler = $this->get_memberlist_leaders_table_crawler(); - $this->assertNotContains('admin', $crawler->eq(0)->text()); - $this->assertContains('admin', $crawler->eq(1)->text()); + $this->assertStringNotContainsString('admin', $crawler->eq(0)->text()); + $this->assertStringContainsString('admin', $crawler->eq(1)->text()); // Add admin to admins as leader, should be visible as admin, not moderator $this->add_user_group('ADMINISTRATORS', array('admin'), true, true); $crawler = $this->get_memberlist_leaders_table_crawler(); - $this->assertContains('admin', $crawler->eq(0)->text()); - $this->assertNotContains('admin', $crawler->eq(1)->text()); + $this->assertStringContainsString('admin', $crawler->eq(0)->text()); + $this->assertStringNotContainsString('admin', $crawler->eq(1)->text()); } public function test_group_rank() @@ -130,7 +130,7 @@ class phpbb_functional_memberlist_test extends phpbb_functional_test_case $this->assertContainsLang('RANK_UPDATED', $crawler->filter('.successbox')->text()); $crawler = self::request('GET', 'memberlist.php?mode=group&g=2'); - $this->assertContains('memberlist-test-user', $crawler->text()); + $this->assertStringContainsString('memberlist-test-user', $crawler->text()); unlink(__DIR__ . '/../../phpBB/images/ranks/valid.jpg'); } diff --git a/tests/functional/metadata_manager_test.php b/tests/functional/metadata_manager_test.php index 3ffed7f66d..59d3bcbc07 100644 --- a/tests/functional/metadata_manager_test.php +++ b/tests/functional/metadata_manager_test.php @@ -63,9 +63,9 @@ class phpbb_functional_metadata_manager_test extends phpbb_functional_test_case public function test_extensions_list() { $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&sid=' . $this->sid); - $this->assertContains($this->lang('EXTENSIONS_EXPLAIN'), $crawler->filter('#main')->text()); - $this->assertContains('phpBB 3.1 Extension Testing', $crawler->filter('#main')->text()); - $this->assertContains('Details', $crawler->filter('#main')->text()); + $this->assertStringContainsString($this->lang('EXTENSIONS_EXPLAIN'), $crawler->filter('#main')->text()); + $this->assertStringContainsString('phpBB 3.1 Extension Testing', $crawler->filter('#main')->text()); + $this->assertStringContainsString('Details', $crawler->filter('#main')->text()); } public function test_extensions_details() @@ -73,15 +73,15 @@ class phpbb_functional_metadata_manager_test extends phpbb_functional_test_case $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=details&ext_name=foo%2Fbar&sid=' . $this->sid); // Test whether the details are displayed - $this->assertContains($this->lang('CLEAN_NAME'), $crawler->filter('#main')->text()); - $this->assertContains('foo/bar', $crawler->filter('#meta_name')->text()); + $this->assertStringContainsString($this->lang('CLEAN_NAME'), $crawler->filter('#main')->text()); + $this->assertStringContainsString('foo/bar', $crawler->filter('#meta_name')->text()); - $this->assertContains($this->lang('PHP_VERSION'), $crawler->filter('#main')->text()); - $this->assertContains('>=5.3', $crawler->filter('#require_php')->text()); + $this->assertStringContainsString($this->lang('PHP_VERSION'), $crawler->filter('#main')->text()); + $this->assertStringContainsString('>=5.3', $crawler->filter('#require_php')->text()); // Details should be html escaped // However, text() only returns the displayed text, so HTML Special Chars are decoded. // So we test this directly on the content of the response. - $this->assertContains('>=5.3', $this->get_content()); + $this->assertStringContainsString('>=5.3', $this->get_content()); } public function test_extensions_details_notexists() @@ -89,6 +89,6 @@ class phpbb_functional_metadata_manager_test extends phpbb_functional_test_case $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=details&ext_name=not%2Fexists&sid=' . $this->sid); // Error message because the files do not exist - $this->assertContains($this->lang('FILE_NOT_FOUND', ''), $crawler->filter('#main')->text()); + $this->assertStringContainsString($this->lang('FILE_NOT_FOUND', ''), $crawler->filter('#main')->text()); } } diff --git a/tests/functional/notification_test.php b/tests/functional/notification_test.php index 4ca1d4b637..62355bf493 100644 --- a/tests/functional/notification_test.php +++ b/tests/functional/notification_test.php @@ -67,7 +67,7 @@ class phpbb_functional_notification_test extends phpbb_functional_test_case // Post a new post that needs approval $this->create_post(2, 1, 'Re: Welcome to phpBB3', 'This is a test [b]post[/b] posted by notificationtestuser.', array(), 'POST_STORED_MOD'); $crawler = self::request('GET', "viewtopic.php?t=1&sid={$this->sid}"); - $this->assertNotContains('This is a test post posted by notificationtestuser.', $crawler->filter('html')->text()); + $this->assertStringNotContainsString('This is a test post posted by notificationtestuser.', $crawler->filter('html')->text()); // Login as admin $this->logout(); diff --git a/tests/functional/paging_test.php b/tests/functional/paging_test.php index cfaf9104a8..f6d6960919 100644 --- a/tests/functional/paging_test.php +++ b/tests/functional/paging_test.php @@ -27,17 +27,17 @@ class phpbb_functional_paging_test extends phpbb_functional_test_case $this->create_post(2, $post['topic_id'], 'Re: Test Topic 1', 'This is a test post no' . $post_id . ' posted by the testing framework.'); } $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}"); - $this->assertContains('post no4', $crawler->text()); - $this->assertNotContains('post no16', $crawler->text()); + $this->assertStringContainsString('post no4', $crawler->text()); + $this->assertStringNotContainsString('post no16', $crawler->text()); $next_link = $crawler->filter('.pagination > ul > li.next > a')->attr('href'); $crawler = self::request('GET', $next_link); - $this->assertNotContains('post no4', $crawler->text()); - $this->assertContains('post no16', $crawler->text()); + $this->assertStringNotContainsString('post no4', $crawler->text()); + $this->assertStringContainsString('post no16', $crawler->text()); $prev_link = $crawler->filter('.pagination > ul > li.previous > a')->attr('href'); $crawler = self::request('GET', $prev_link); - $this->assertContains('post no4', $crawler->text()); - $this->assertNotContains('post no16', $crawler->text()); + $this->assertStringContainsString('post no4', $crawler->text()); + $this->assertStringNotContainsString('post no16', $crawler->text()); } } diff --git a/tests/functional/plupload_test.php b/tests/functional/plupload_test.php index 990983985e..f28b3f621e 100644 --- a/tests/functional/plupload_test.php +++ b/tests/functional/plupload_test.php @@ -111,7 +111,7 @@ class phpbb_functional_plupload_test extends phpbb_functional_test_case if ($i < self::CHUNKS - 1) { - $this->assertContains('{"jsonrpc":"2.0","id":"id","result":null}', self::get_content()); + $this->assertStringContainsString('{"jsonrpc":"2.0","id":"id","result":null}', self::get_content()); } else { diff --git a/tests/functional/posting_test.php b/tests/functional/posting_test.php index 49447e1133..38edcf6767 100644 --- a/tests/functional/posting_test.php +++ b/tests/functional/posting_test.php @@ -24,17 +24,17 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case $post = $this->create_topic(2, 'Test Topic 1', 'This is a test topic posted by the testing framework.'); $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}"); - $this->assertContains('This is a test topic posted by the testing framework.', $crawler->filter('html')->text()); + $this->assertStringContainsString('This is a test topic posted by the testing framework.', $crawler->filter('html')->text()); // Test creating a reply with bbcode $post2 = $this->create_post(2, $post['topic_id'], 'Re: Test Topic 1', 'This is a test [b]post[/b] posted by the testing framework.'); $crawler = self::request('GET', "viewtopic.php?p={$post2['post_id']}&sid={$this->sid}"); - $this->assertContains('This is a test post posted by the testing framework.', $crawler->filter('html')->text()); + $this->assertStringContainsString('This is a test post posted by the testing framework.', $crawler->filter('html')->text()); // Test quoting a message $crawler = self::request('GET', "posting.php?mode=quote&f=2&t={$post2['topic_id']}&p={$post2['post_id']}&sid={$this->sid}"); - $this->assertContains('This is a test post posted by the testing framework.', $crawler->filter('html')->text()); + $this->assertStringContainsString('This is a test post posted by the testing framework.', $crawler->filter('html')->text()); } public function test_unsupported_characters() @@ -44,7 +44,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case $post = $this->create_topic(2, "Test Topic \xF0\x9F\xA4\x94 3\xF0\x9D\x94\xBB\xF0\x9D\x95\x9A", 'This is a test with emoji character in the topic title.'); $this->create_post(2, $post['topic_id'], "Re: Test Topic 1 \xF0\x9F\xA4\x94 3\xF0\x9D\x94\xBB\xF0\x9D\x95\x9A", 'This is a test with emoji characters in the topic title.'); $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}"); - $this->assertContains("\xF0\x9F\xA4\x94 3\xF0\x9D\x94\xBB\xF0\x9D\x95\x9A", $crawler->text()); + $this->assertStringContainsString("\xF0\x9F\xA4\x94 3\xF0\x9D\x94\xBB\xF0\x9D\x95\x9A", $crawler->text()); } public function test_supported_unicode_characters() @@ -54,7 +54,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case $post = $this->create_topic(2, 'Test Topic 1', 'This is a test topic posted by the testing framework.'); $this->create_post(2, $post['topic_id'], 'Re: Test Topic 1', "This is a test with these weird characters: \xF0\x9F\x84\x90 \xF0\x9F\x84\x91"); $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}"); - $this->assertContains("\xF0\x9F\x84\x90 \xF0\x9F\x84\x91", $crawler->text()); + $this->assertStringContainsString("\xF0\x9F\x84\x90 \xF0\x9F\x84\x91", $crawler->text()); } public function test_html_entities() @@ -64,7 +64,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case $post = $this->create_topic(2, 'Test Topic 1', 'This is a test topic posted by the testing framework.'); $this->create_post(2, $post['topic_id'], 'Re: Test Topic 1', '😀'); $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}"); - $this->assertContains('😀', $crawler->text()); + $this->assertStringContainsString('😀', $crawler->text()); } public function test_quote() @@ -96,7 +96,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case $form->setValues(array('message' => 'Edited post')); $crawler = self::submit($form); - $this->assertContains('Edited post', $crawler->filter("#post_content{$post_id} .content")->text()); + $this->assertStringContainsString('Edited post', $crawler->filter("#post_content{$post_id} .content")->text()); } /** @@ -163,11 +163,11 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case $text_content = $crawler->filter('#p' . $post['post_id'])->text(); foreach ($contains[$quote_depth] as $contains_text) { - $this->assertContains($contains_text, $text_content); + $this->assertStringContainsString($contains_text, $text_content); } foreach ($not_contains[$quote_depth] as $not_contains_text) { - $this->assertNotContains($not_contains_text, $text_content); + $this->assertStringNotContainsString($not_contains_text, $text_content); } } } @@ -229,7 +229,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case 'message' => 'My post', )); $crawler = self::submit($form); - $this->assertContains( + $this->assertStringContainsString( 'My signature', $crawler->filter('#preview .signature')->html() ); @@ -274,7 +274,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case 'message' => $text, )); $crawler = self::submit($form); - $this->assertContains( + $this->assertStringContainsString( 'http://example.org/ tcp://localhost:22/ServiceName', $crawler->filter('#preview .content')->html() ); @@ -295,7 +295,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case 'message' => $text, )); $crawler = self::submit($form); - $this->assertContains( + $this->assertStringContainsString( 'http://example.org/ tcp://localhost:22/ServiceName', $crawler->filter('#preview .content')->html() ); diff --git a/tests/functional/private_messages_test.php b/tests/functional/private_messages_test.php index ce709524a9..6f94eac35c 100644 --- a/tests/functional/private_messages_test.php +++ b/tests/functional/private_messages_test.php @@ -32,7 +32,7 @@ class phpbb_functional_private_messages_test extends phpbb_functional_test_case $form->setValues($values); $crawler = self::submit($form); - $this->assertContains($this->lang('CONFIG_UPDATED'), $crawler->filter('.successbox')->text()); + $this->assertStringContainsString($this->lang('CONFIG_UPDATED'), $crawler->filter('.successbox')->text()); } public function test_inbox_full() @@ -41,12 +41,12 @@ class phpbb_functional_private_messages_test extends phpbb_functional_test_case $message_id = $this->create_private_message('Test private message #1', 'This is a test private message sent by the testing framework.', array(2)); $crawler = self::request('GET', "ucp.php?i=pm&mode=view&sid{$this->sid}&p={$message_id}"); - $this->assertContains($this->lang('UCP_PM_VIEW'), $crawler->filter('html')->text()); + $this->assertStringContainsString($this->lang('UCP_PM_VIEW'), $crawler->filter('html')->text()); $message_id = $this->create_private_message('Test private message #2', 'This is a test private message sent by the testing framework.', array(2)); $crawler = self::request('GET', "ucp.php?i=pm&mode=view&sid{$this->sid}&p={$message_id}"); - $this->assertContains($this->lang('NO_AUTH_READ_HOLD_MESSAGE'), $crawler->filter('html')->text()); + $this->assertStringContainsString($this->lang('NO_AUTH_READ_HOLD_MESSAGE'), $crawler->filter('html')->text()); } public function test_restore_config() @@ -64,7 +64,7 @@ class phpbb_functional_private_messages_test extends phpbb_functional_test_case $form->setValues($values); $crawler = self::submit($form); - $this->assertContains($this->lang('CONFIG_UPDATED'), $crawler->filter('.successbox')->text()); + $this->assertStringContainsString($this->lang('CONFIG_UPDATED'), $crawler->filter('.successbox')->text()); } public function test_quote_post() @@ -105,6 +105,6 @@ class phpbb_functional_private_messages_test extends phpbb_functional_test_case $crawler = self::request('GET', 'ucp.php?i=pm&mode=compose&action=forward&f=0&p=' . $message_id . '&sid=' . $this->sid); - $this->assertContains($expected, $crawler->filter('textarea#message')->text()); + $this->assertStringContainsString($expected, $crawler->filter('textarea#message')->text()); } } diff --git a/tests/functional/prune_shadow_topic_test.php b/tests/functional/prune_shadow_topic_test.php index 9bf54fcb19..698acc7550 100644 --- a/tests/functional/prune_shadow_topic_test.php +++ b/tests/functional/prune_shadow_topic_test.php @@ -61,7 +61,7 @@ class phpbb_functional_prune_shadow_topic_test extends phpbb_functional_test_cas $this->post = $this->create_topic($this->data['forums']['Prune Shadow'], 'Prune Shadow #1', 'This is a test topic posted by the testing framework.'); $crawler = self::request('GET', "viewtopic.php?t={$this->post['topic_id']}&sid={$this->sid}"); - $this->assertContains('Prune Shadow #1', $crawler->filter('html')->text()); + $this->assertStringContainsString('Prune Shadow #1', $crawler->filter('html')->text()); $this->data['topics']['Prune Shadow #1'] = (int) $this->post['topic_id']; $this->data['posts']['Prune Shadow #1'] = (int) $this->get_parameter_from_link($crawler->filter('.post')->selectLink($this->lang('POST', '', ''))->link()->getUri(), 'p'); @@ -79,7 +79,7 @@ class phpbb_functional_prune_shadow_topic_test extends phpbb_functional_test_cas $post2 = $this->create_post($this->data['forums']['Prune Shadow'], $this->post['topic_id'], 'Re: Prune Shadow #1-#2', 'This is a test post posted by the testing framework.'); $crawler = self::request('GET', "viewtopic.php?p={$post2['post_id']}&sid={$this->sid}"); - $this->assertContains('Re: Prune Shadow #1-#2', $crawler->filter('html')->text()); + $this->assertStringContainsString('Re: Prune Shadow #1-#2', $crawler->filter('html')->text()); $this->data['posts']['Re: Prune Shadow #1-#2'] = (int) $post2['post_id']; $this->assert_forum_details($this->data['forums']['Prune Shadow'], array( diff --git a/tests/functional/report_post_captcha_test.php b/tests/functional/report_post_captcha_test.php index 36a1a9ee4d..e4c2ff6ab7 100644 --- a/tests/functional/report_post_captcha_test.php +++ b/tests/functional/report_post_captcha_test.php @@ -21,11 +21,11 @@ class phpbb_functional_report_post_captcha_test extends phpbb_functional_test_ca $crawler = self::request('GET', 'app.php/post/1/report', array(), false); $this->assert_response_html(403); $this->add_lang('mcp'); - $this->assertContains($this->lang('USER_CANNOT_REPORT'), $crawler->filter('html')->text()); + $this->assertStringContainsString($this->lang('USER_CANNOT_REPORT'), $crawler->filter('html')->text()); $this->set_reporting_guest(1); $crawler = self::request('GET', 'app.php/post/1/report'); - $this->assertContains($this->lang('CONFIRM_CODE'), $crawler->filter('html')->text()); + $this->assertStringContainsString($this->lang('CONFIRM_CODE'), $crawler->filter('html')->text()); $this->set_reporting_guest(-1); } @@ -33,12 +33,12 @@ class phpbb_functional_report_post_captcha_test extends phpbb_functional_test_ca { $this->login(); $crawler = self::request('GET', 'app.php/post/1/report'); - $this->assertNotContains($this->lang('CONFIRM_CODE'), $crawler->filter('html')->text()); + $this->assertStringNotContainsString($this->lang('CONFIRM_CODE'), $crawler->filter('html')->text()); $this->add_lang('mcp'); $form = $crawler->selectButton($this->lang('SUBMIT'))->form(); $crawler = self::submit($form); - $this->assertContains($this->lang('POST_REPORTED_SUCCESS'), $crawler->text()); + $this->assertStringContainsString($this->lang('POST_REPORTED_SUCCESS'), $crawler->text()); } protected function set_reporting_guest($report_post_allowed) diff --git a/tests/functional/subforum_test.php b/tests/functional/subforum_test.php index 6ce4f53c20..493c2053da 100644 --- a/tests/functional/subforum_test.php +++ b/tests/functional/subforum_test.php @@ -64,8 +64,8 @@ class phpbb_functional_subforum_test extends phpbb_functional_test_case public function test_display_subforums() { $crawler = self::request('GET', "index.php?sid={$this->sid}"); - $this->assertContains('Subforum Test #1.1', $crawler->html()); - $this->assertContains('Subforum Test #1.1.1', $crawler->html()); + $this->assertStringContainsString('Subforum Test #1.1', $crawler->html()); + $this->assertStringContainsString('Subforum Test #1.1.1', $crawler->html()); } /** @@ -85,8 +85,8 @@ class phpbb_functional_subforum_test extends phpbb_functional_test_case self::submit($form); $crawler = self::request('GET', "index.php?sid={$this->sid}"); - $this->assertContains('Subforum Test #1.1', $crawler->html()); - $this->assertNotContains('Subforum Test #1.1.1', $crawler->html()); + $this->assertStringContainsString('Subforum Test #1.1', $crawler->html()); + $this->assertStringNotContainsString('Subforum Test #1.1.1', $crawler->html()); } protected function get_forum_id($forum_name) diff --git a/tests/functional/ucp_groups_test.php b/tests/functional/ucp_groups_test.php index 445c124158..f8e801dcf7 100644 --- a/tests/functional/ucp_groups_test.php +++ b/tests/functional/ucp_groups_test.php @@ -51,7 +51,7 @@ class phpbb_functional_ucp_groups_test extends phpbb_functional_common_groups_te $form = $this->get_group_manage_form(); $teampage_settings = $this->get_teampage_settings(); $crawler = self::submit($form); - $this->assertContains($this->lang('GROUP_UPDATED'), $crawler->text()); + $this->assertStringContainsString($this->lang('GROUP_UPDATED'), $crawler->text()); $this->assertEquals($teampage_settings, $this->get_teampage_settings()); } diff --git a/tests/functional/user_password_reset_test.php b/tests/functional/user_password_reset_test.php index 2c8be363e7..eb6631bf28 100644 --- a/tests/functional/user_password_reset_test.php +++ b/tests/functional/user_password_reset_test.php @@ -25,7 +25,7 @@ class phpbb_functional_user_password_reset_test extends phpbb_functional_test_ca // test without email $crawler = self::request('GET', "ucp.php?mode=sendpassword&sid={$this->sid}"); - $this->assertContains('app.php/user/forgot_password', $crawler->getUri()); + $this->assertStringContainsString('app.php/user/forgot_password', $crawler->getUri()); $form = $crawler->selectButton('submit')->form(); $crawler = self::submit($form); $this->assertContainsLang('NO_EMAIL_USER', $crawler->text()); @@ -143,11 +143,11 @@ class phpbb_functional_user_password_reset_test extends phpbb_functional_test_ca { $this->add_lang('ucp'); $crawler = self::request('GET', 'ucp.php'); - $this->assertContains($this->lang('LOGIN_EXPLAIN_UCP'), $crawler->filter('html')->text()); + $this->assertStringContainsString($this->lang('LOGIN_EXPLAIN_UCP'), $crawler->filter('html')->text()); $form = $crawler->selectButton($this->lang('LOGIN'))->form(); $crawler = self::submit($form, array('username' => 'reset-password-test-user', 'password' => 'reset-password-test-user')); - $this->assertNotContains($this->lang('LOGIN'), $crawler->filter('.navbar')->text()); + $this->assertStringNotContainsString($this->lang('LOGIN'), $crawler->filter('.navbar')->text()); $cookies = self::$cookieJar->all(); @@ -163,12 +163,12 @@ class phpbb_functional_user_password_reset_test extends phpbb_functional_test_ca $this->logout(); $crawler = self::request('GET', 'ucp.php'); - $this->assertContains($this->lang('LOGIN_EXPLAIN_UCP'), $crawler->filter('html')->text()); + $this->assertStringContainsString($this->lang('LOGIN_EXPLAIN_UCP'), $crawler->filter('html')->text()); $form = $crawler->selectButton($this->lang('LOGIN'))->form(); // Try logging in with the old password $crawler = self::submit($form, array('username' => 'reset-password-test-user', 'password' => 'reset-password-test-userreset-password-test-user')); - $this->assertContains($this->lang('LOGIN_ERROR_PASSWORD', '', ''), $crawler->filter('html')->text()); + $this->assertStringContainsString($this->lang('LOGIN_ERROR_PASSWORD', '', ''), $crawler->filter('html')->text()); } /** diff --git a/tests/functional/viewforum_paging_test.php b/tests/functional/viewforum_paging_test.php index 4a574bebbb..2ba29cecc6 100644 --- a/tests/functional/viewforum_paging_test.php +++ b/tests/functional/viewforum_paging_test.php @@ -127,8 +127,8 @@ class viewforum_paging_test extends phpbb_functional_test_case $this->assertEquals(2, $crawler->filter('div.pagination')->count()); $top_pagination = $crawler->filter('div.pagination')->eq(0); $this->assertEquals(3, $top_pagination->filter('li')->count(), 'Number of pagination items on page 1 does not match'); - $this->assertContains('1', $top_pagination->filter('li')->eq(0)->text()); - $this->assertContains('2', $top_pagination->filter('li')->eq(1)->text()); + $this->assertStringContainsString('1', $top_pagination->filter('li')->eq(0)->text()); + $this->assertStringContainsString('2', $top_pagination->filter('li')->eq(1)->text()); $this->assertContainsLang('NEXT', $top_pagination->filter('li')->eq(2)->text()); } @@ -157,8 +157,8 @@ class viewforum_paging_test extends phpbb_functional_test_case $top_pagination = $crawler->filter('div.pagination')->eq(0); $this->assertEquals(3, $top_pagination->filter('li')->count(), 'Number of pagination items on page 2 does not match'); $this->assertContainsLang('PREVIOUS', $top_pagination->filter('li')->eq(0)->text()); - $this->assertContains('1', $top_pagination->filter('li')->eq(1)->text()); - $this->assertContains('2', $top_pagination->filter('li')->eq(2)->text()); + $this->assertStringContainsString('1', $top_pagination->filter('li')->eq(1)->text()); + $this->assertStringContainsString('2', $top_pagination->filter('li')->eq(2)->text()); } protected function assert_forum_details($forum_id, $details, $additional_error_message = '') diff --git a/tests/functional/visibility_disapprove_test.php b/tests/functional/visibility_disapprove_test.php index 6f6edba422..cb38f64aed 100644 --- a/tests/functional/visibility_disapprove_test.php +++ b/tests/functional/visibility_disapprove_test.php @@ -60,7 +60,7 @@ class phpbb_functional_visibility_disapprove_test extends phpbb_functional_test_ $post = $this->create_topic($this->data['forums']['Disapprove Test #1'], 'Disapprove Test Topic #1', 'This is a test topic posted by the testing framework.'); $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}"); - $this->assertContains('Disapprove Test Topic #1', $crawler->filter('html')->text()); + $this->assertStringContainsString('Disapprove Test Topic #1', $crawler->filter('html')->text()); $this->data['topics']['Disapprove Test Topic #1'] = (int) $post['topic_id']; $this->data['posts']['Disapprove Test Topic #1'] = (int) $this->get_parameter_from_link($crawler->filter('.post')->selectLink($this->lang('POST', '', ''))->link()->getUri(), 'p'); @@ -83,7 +83,7 @@ class phpbb_functional_visibility_disapprove_test extends phpbb_functional_test_ $post2 = $this->create_post($this->data['forums']['Disapprove Test #1'], $post['topic_id'], 'Re: Disapprove Test Topic #1-#2', 'This is a test post posted by the testing framework.', array(), 'POST_STORED_MOD'); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Disapprove Test Topic #1']}&sid={$this->sid}"); - $this->assertNotContains('Re: Disapprove Test Topic #1-#2', $crawler->filter('html')->text()); + $this->assertStringNotContainsString('Re: Disapprove Test Topic #1-#2', $crawler->filter('html')->text()); $this->assert_forum_details($this->data['forums']['Disapprove Test #1'], array( 'forum_posts_approved' => 1, @@ -99,7 +99,7 @@ class phpbb_functional_visibility_disapprove_test extends phpbb_functional_test_ $post = $this->create_topic($this->data['forums']['Disapprove Test #1'], 'Disapprove Test Topic #2', 'This is a test topic posted by the testing framework.', array(), 'POST_STORED_MOD'); $crawler = self::request('GET', "viewforum.php?f={$this->data['forums']['Disapprove Test #1']}&sid={$this->sid}"); - $this->assertNotContains('Disapprove Test Topic #2', $crawler->filter('html')->text()); + $this->assertStringNotContainsString('Disapprove Test Topic #2', $crawler->filter('html')->text()); $this->assert_forum_details($this->data['forums']['Disapprove Test #1'], array( 'forum_posts_approved' => 1, @@ -155,8 +155,8 @@ class phpbb_functional_visibility_disapprove_test extends phpbb_functional_test_ $this->add_lang('viewtopic'); $this->add_lang('mcp'); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Disapprove Test Topic #1']}&sid={$this->sid}"); - $this->assertContains('Disapprove Test Topic #1', $crawler->filter('html')->text()); - $this->assertContains('Re: Disapprove Test Topic #1-#2', $crawler->filter('html')->text()); + $this->assertStringContainsString('Disapprove Test Topic #1', $crawler->filter('html')->text()); + $this->assertStringContainsString('Re: Disapprove Test Topic #1-#2', $crawler->filter('html')->text()); $form = $crawler->selectButton($this->lang('DISAPPROVE'))->form(); $crawler = self::submit($form); @@ -176,11 +176,11 @@ class phpbb_functional_visibility_disapprove_test extends phpbb_functional_test_ $link = $crawler->selectLink($this->lang('RETURN_PAGE', '', ''))->link(); $link_url = $link->getUri(); - $this->assertContains('viewtopic.php?f=' . $this->data['forums']['Disapprove Test #1'] . '&t=' . $this->data['topics']['Disapprove Test Topic #1'], $link_url); + $this->assertStringContainsString('viewtopic.php?f=' . $this->data['forums']['Disapprove Test #1'] . '&t=' . $this->data['topics']['Disapprove Test Topic #1'], $link_url); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Disapprove Test Topic #1']}&sid={$this->sid}"); - $this->assertContains('Disapprove Test Topic #1', $crawler->filter('html')->text()); - $this->assertNotContains('Re: Disapprove Test Topic #1-#2', $crawler->filter('html')->text()); + $this->assertStringContainsString('Disapprove Test Topic #1', $crawler->filter('html')->text()); + $this->assertStringNotContainsString('Re: Disapprove Test Topic #1-#2', $crawler->filter('html')->text()); } public function test_disapprove_topic() @@ -214,7 +214,7 @@ class phpbb_functional_visibility_disapprove_test extends phpbb_functional_test_ $this->add_lang('viewtopic'); $this->add_lang('mcp'); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Disapprove Test Topic #2']}&sid={$this->sid}"); - $this->assertContains('Disapprove Test Topic #2', $crawler->filter('html')->text()); + $this->assertStringContainsString('Disapprove Test Topic #2', $crawler->filter('html')->text()); $form = $crawler->selectButton($this->lang('DISAPPROVE'))->form(); $crawler = self::submit($form); @@ -234,11 +234,11 @@ class phpbb_functional_visibility_disapprove_test extends phpbb_functional_test_ $link = $crawler->selectLink($this->lang('RETURN_PAGE', '', ''))->link(); $link_url = $link->getUri(); - $this->assertContains('viewforum.php?f=' . $this->data['forums']['Disapprove Test #1'], $link_url); + $this->assertStringContainsString('viewforum.php?f=' . $this->data['forums']['Disapprove Test #1'], $link_url); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Disapprove Test Topic #2']}&sid={$this->sid}", array(), false); self::assert_response_html(404); - $this->assertNotContains('Disapprove Test Topic #2', $crawler->filter('html')->text()); + $this->assertStringNotContainsString('Disapprove Test Topic #2', $crawler->filter('html')->text()); } protected function assert_forum_details($forum_id, $details, $additional_error_message = '') diff --git a/tests/functional/visibility_reapprove_test.php b/tests/functional/visibility_reapprove_test.php index 6a6e2edf18..555e6d7f9d 100644 --- a/tests/functional/visibility_reapprove_test.php +++ b/tests/functional/visibility_reapprove_test.php @@ -60,7 +60,7 @@ class phpbb_functional_visibility_reapprove_test extends phpbb_functional_test_c $post = $this->create_topic($this->data['forums']['Reapprove Test #1'], 'Reapprove Test Topic #1', 'This is a test topic posted by the testing framework.'); $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}"); - $this->assertContains('Reapprove Test Topic #1', $crawler->filter('h2')->text()); + $this->assertStringContainsString('Reapprove Test Topic #1', $crawler->filter('h2')->text()); $this->data['topics']['Reapprove Test Topic #1'] = (int) $post['topic_id']; $this->data['posts']['Reapprove Test Topic #1'] = (int) $this->get_parameter_from_link($crawler->filter('.post')->selectLink($this->lang('POST', '', ''))->link()->getUri(), 'p'); @@ -83,7 +83,7 @@ class phpbb_functional_visibility_reapprove_test extends phpbb_functional_test_c $post2 = $this->create_post($this->data['forums']['Reapprove Test #1'], $post['topic_id'], 'Re: Reapprove Test Topic #1-#2', 'This is a test post posted by the testing framework.', array(), 'POST_STORED_MOD'); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #1']}&sid={$this->sid}"); - $this->assertNotContains('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text()); + $this->assertStringNotContainsString('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text()); $this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array( 'forum_posts_approved' => 1, @@ -99,7 +99,7 @@ class phpbb_functional_visibility_reapprove_test extends phpbb_functional_test_c $post = $this->create_topic($this->data['forums']['Reapprove Test #1'], 'Reapprove Test Topic #2', 'This is a test topic posted by the testing framework.', array(), 'POST_STORED_MOD'); $crawler = self::request('GET', "viewforum.php?f={$this->data['forums']['Reapprove Test #1']}&sid={$this->sid}"); - $this->assertNotContains('Reapprove Test Topic #2', $crawler->filter('html')->text()); + $this->assertStringNotContainsString('Reapprove Test Topic #2', $crawler->filter('html')->text()); $this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array( 'forum_posts_approved' => 1, @@ -146,8 +146,8 @@ class phpbb_functional_visibility_reapprove_test extends phpbb_functional_test_c $this->add_lang('viewtopic'); $this->add_lang('mcp'); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #1']}&sid={$this->sid}"); - $this->assertContains('Reapprove Test Topic #1', $crawler->filter('h2')->text()); - $this->assertContains('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text()); + $this->assertStringContainsString('Reapprove Test Topic #1', $crawler->filter('h2')->text()); + $this->assertStringContainsString('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text()); $form = $crawler->selectButton($this->lang('APPROVE'))->form(); $crawler = self::submit($form); @@ -167,11 +167,11 @@ class phpbb_functional_visibility_reapprove_test extends phpbb_functional_test_c $link = $crawler->selectLink($this->lang('RETURN_PAGE', '', ''))->link(); $link_url = $link->getUri(); - $this->assertContains('viewtopic.php?f=' . $this->data['forums']['Reapprove Test #1'] . '&t=' . $this->data['topics']['Reapprove Test Topic #1'], $link_url); + $this->assertStringContainsString('viewtopic.php?f=' . $this->data['forums']['Reapprove Test #1'] . '&t=' . $this->data['topics']['Reapprove Test Topic #1'], $link_url); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #1']}&sid={$this->sid}"); - $this->assertContains('Reapprove Test Topic #1', $crawler->filter('h2')->text()); - $this->assertContains('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text()); + $this->assertStringContainsString('Reapprove Test Topic #1', $crawler->filter('h2')->text()); + $this->assertStringContainsString('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text()); } public function test_approve_topic() @@ -206,7 +206,7 @@ class phpbb_functional_visibility_reapprove_test extends phpbb_functional_test_c $this->add_lang('viewtopic'); $this->add_lang('mcp'); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #2']}&sid={$this->sid}"); - $this->assertContains('Reapprove Test Topic #2', $crawler->filter('h2')->text()); + $this->assertStringContainsString('Reapprove Test Topic #2', $crawler->filter('h2')->text()); $form = $crawler->selectButton($this->lang('APPROVE'))->form(); $crawler = self::submit($form); @@ -226,10 +226,10 @@ class phpbb_functional_visibility_reapprove_test extends phpbb_functional_test_c $link = $crawler->selectLink($this->lang('RETURN_PAGE', '', ''))->link(); $link_url = $link->getUri(); - $this->assertContains('viewtopic.php?f=' . $this->data['forums']['Reapprove Test #1'], $link_url); + $this->assertStringContainsString('viewtopic.php?f=' . $this->data['forums']['Reapprove Test #1'], $link_url); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #2']}&sid={$this->sid}"); - $this->assertContains('Reapprove Test Topic #2', $crawler->filter('h2')->text()); + $this->assertStringContainsString('Reapprove Test Topic #2', $crawler->filter('h2')->text()); } public function test_edit_posts() @@ -273,8 +273,8 @@ class phpbb_functional_visibility_reapprove_test extends phpbb_functional_test_c $this->submit_post($posting_url, 'EDIT_POST', $form_data, 'POST_EDITED_MOD'); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #1']}&sid={$this->sid}"); - $this->assertNotContains('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text()); - $this->assertNotContains('Post edited by testing framework', $crawler->filter('#page-body')->text()); + $this->assertStringNotContainsString('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text()); + $this->assertStringNotContainsString('Post edited by testing framework', $crawler->filter('#page-body')->text()); $this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array( 'forum_posts_approved' => 2, @@ -297,8 +297,8 @@ class phpbb_functional_visibility_reapprove_test extends phpbb_functional_test_c $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #2']}&sid={$this->sid}", array(), false); self::assert_response_html(404); - $this->assertNotContains('Reapprove Test Topic #2', $crawler->filter('#page-body')->text()); - $this->assertNotContains('Post edited by testing framework', $crawler->filter('#page-body')->text()); + $this->assertStringNotContainsString('Reapprove Test Topic #2', $crawler->filter('#page-body')->text()); + $this->assertStringNotContainsString('Post edited by testing framework', $crawler->filter('#page-body')->text()); $this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array( 'forum_posts_approved' => 1, @@ -314,8 +314,8 @@ class phpbb_functional_visibility_reapprove_test extends phpbb_functional_test_c $this->login(); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #1']}&sid={$this->sid}"); - $this->assertContains('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text()); - $this->assertContains('Post edited by testing framework', $crawler->filter('#page-body')->text()); + $this->assertStringContainsString('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text()); + $this->assertStringContainsString('Post edited by testing framework', $crawler->filter('#page-body')->text()); } public function test_approve_post_again() diff --git a/tests/functional/visibility_softdelete_test.php b/tests/functional/visibility_softdelete_test.php index fd994361a5..4eba77ba1b 100644 --- a/tests/functional/visibility_softdelete_test.php +++ b/tests/functional/visibility_softdelete_test.php @@ -81,7 +81,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ $post = $this->create_topic($this->data['forums']['Soft Delete #1'], 'Soft Delete Topic #1', 'This is a test topic posted by the testing framework.'); $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}"); - $this->assertContains('Soft Delete Topic #1', $crawler->filter('html')->text()); + $this->assertStringContainsString('Soft Delete Topic #1', $crawler->filter('html')->text()); $this->data['topics']['Soft Delete Topic #1'] = (int) $post['topic_id']; $this->data['posts']['Soft Delete Topic #1'] = (int) $this->get_parameter_from_link($crawler->filter('.post')->selectLink($this->lang('POST', '', ''))->link()->getUri(), 'p'); @@ -99,7 +99,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ $post2 = $this->create_post($this->data['forums']['Soft Delete #1'], $post['topic_id'], 'Re: Soft Delete Topic #1-#2', 'This is a test post posted by the testing framework.'); $crawler = self::request('GET', "viewtopic.php?p={$post2['post_id']}&sid={$this->sid}"); - $this->assertContains('Re: Soft Delete Topic #1-#2', $crawler->filter('html')->text()); + $this->assertStringContainsString('Re: Soft Delete Topic #1-#2', $crawler->filter('html')->text()); $this->data['posts']['Re: Soft Delete Topic #1-#2'] = (int) $post2['post_id']; $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array( @@ -116,7 +116,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ $post3 = $this->create_post($this->data['forums']['Soft Delete #1'], $post['topic_id'], 'Re: Soft Delete Topic #1-#3', 'This is another test post posted by the testing framework.'); $crawler = self::request('GET', "viewtopic.php?p={$post3['post_id']}&sid={$this->sid}"); - $this->assertContains('Re: Soft Delete Topic #1-#3', $crawler->filter('html')->text()); + $this->assertStringContainsString('Re: Soft Delete Topic #1-#3', $crawler->filter('html')->text()); $this->data['posts']['Re: Soft Delete Topic #1-#3'] = (int) $post3['post_id']; $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array( @@ -177,7 +177,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ ), 'after softdelete'); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}"); - $this->assertContains($this->lang('POST_DISPLAY', '', ''), $crawler->text()); + $this->assertStringContainsString($this->lang('POST_DISPLAY', '', ''), $crawler->text()); } public function test_softdelete_post_no_m_delete() @@ -227,7 +227,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ ), 'after softdelete without m_delete'); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}"); - $this->assertContains($this->lang('POST_DISPLAY', '', ''), $crawler->text()); + $this->assertStringContainsString($this->lang('POST_DISPLAY', '', ''), $crawler->text()); } public function test_move_softdeleted_post() @@ -278,8 +278,8 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ $this->assertContainsLang('TOPIC_MOVED_SUCCESS', $crawler->text()); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}"); - $this->assertContains('Soft Delete #2', $crawler->filter('.navlinks')->text()); - $this->assertContains('Soft Delete Topic #1', $crawler->filter('h2')->text()); + $this->assertStringContainsString('Soft Delete #2', $crawler->filter('.navlinks')->text()); + $this->assertStringContainsString('Soft Delete Topic #1', $crawler->filter('h2')->text()); $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array( 'forum_posts_approved' => 0, @@ -350,8 +350,8 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ $this->assertContainsLang('TOPIC_DELETED_SUCCESS', $crawler->text()); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}"); - $this->assertContains('Soft Delete #2', $crawler->filter('.navlinks')->text()); - $this->assertContains('Soft Delete Topic #1', $crawler->filter('h2')->text()); + $this->assertStringContainsString('Soft Delete #2', $crawler->filter('.navlinks')->text()); + $this->assertStringContainsString('Soft Delete Topic #1', $crawler->filter('h2')->text()); $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array( 'forum_posts_approved' => 0, @@ -422,8 +422,8 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ $this->assertContainsLang('TOPIC_MOVED_SUCCESS', $crawler->text()); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}"); - $this->assertContains('Soft Delete #1', $crawler->filter('.navlinks')->text()); - $this->assertContains('Soft Delete Topic #1', $crawler->filter('h2')->text()); + $this->assertStringContainsString('Soft Delete #1', $crawler->filter('.navlinks')->text()); + $this->assertStringContainsString('Soft Delete Topic #1', $crawler->filter('h2')->text()); $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array( 'forum_posts_approved' => 0, @@ -496,8 +496,8 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ $this->assertContainsLang('POST_RESTORED_SUCCESS', $crawler->text()); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}"); - $this->assertContains('Soft Delete #1', $crawler->filter('.navlinks')->text()); - $this->assertContains('Soft Delete Topic #1', $crawler->filter('h2')->text()); + $this->assertStringContainsString('Soft Delete #1', $crawler->filter('.navlinks')->text()); + $this->assertStringContainsString('Soft Delete Topic #1', $crawler->filter('h2')->text()); $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array( 'forum_posts_approved' => 1, @@ -575,8 +575,8 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ $this->assertContainsLang('TOPIC_SPLIT_SUCCESS', $crawler->text()); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}"); - $this->assertContains('Soft Delete Topic #1', $crawler->filter('h2')->text()); - $this->assertNotContains('Re: Soft Delete Topic #1-#2', $crawler->text()); + $this->assertStringContainsString('Soft Delete Topic #1', $crawler->filter('h2')->text()); + $this->assertStringNotContainsString('Re: Soft Delete Topic #1-#2', $crawler->text()); $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array( 'forum_posts_approved' => 1, @@ -601,7 +601,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ // Assert new topic title is indexed as well $this->add_lang('search'); self::request('GET', "search.php?keywords=bang&sid={$this->sid}"); - $this->assertContains(sprintf($this->lang['FOUND_SEARCH_MATCHES'][1], 1), self::get_content()); + $this->assertStringContainsString(sprintf($this->lang['FOUND_SEARCH_MATCHES'][1], 1), self::get_content()); } public function test_move_topic_back() @@ -689,7 +689,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ $this->assertContainsLang('POSTS_MERGED_SUCCESS', $crawler->text()); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}"); - $this->assertContains('Soft Delete Topic #1', $crawler->filter('h2')->text()); + $this->assertStringContainsString('Soft Delete Topic #1', $crawler->filter('h2')->text()); $this->assertContainsLang('POST_DELETED_ACTION', $crawler->filter('body')->text()); $this->assertContainsLang('BOOKMARK_TOPIC_REMOVE', $crawler->filter('body')->text()); diff --git a/tests/functional/visibility_unapproved_posts_test.php b/tests/functional/visibility_unapproved_posts_test.php index 8d56af2c4e..52161ff58a 100644 --- a/tests/functional/visibility_unapproved_posts_test.php +++ b/tests/functional/visibility_unapproved_posts_test.php @@ -60,7 +60,7 @@ class phpbb_functional_visibility_unapproved_test extends phpbb_functional_test_ $post = $this->create_topic($this->data['forums']['Unapproved Posts Test #1'], 'Unapproved Posts Test Topic #1', 'This is a test topic posted by the testing framework.'); $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}"); - $this->assertContains('Unapproved Posts Test Topic #1', $crawler->filter('h2')->text()); + $this->assertStringContainsString('Unapproved Posts Test Topic #1', $crawler->filter('h2')->text()); $this->data['topics']['Unapproved Posts Test Topic #1'] = (int) $post['topic_id']; $this->data['posts']['Unapproved Posts Test Topic #1'] = (int) $this->get_parameter_from_link($crawler->filter('.post')->selectLink($this->lang('POST', '', ''))->link()->getUri(), 'p'); @@ -83,7 +83,7 @@ class phpbb_functional_visibility_unapproved_test extends phpbb_functional_test_ $post2 = $this->create_post($this->data['forums']['Unapproved Posts Test #1'], $post['topic_id'], 'Re: Unapproved Posts Test Topic #1-#2', 'This is a test post posted by the testing framework.', [], 'POST_STORED_MOD'); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Unapproved Posts Test Topic #1']}&sid={$this->sid}"); - $this->assertNotContains('Re: Unapproved Posts Test Topic #1-#2', $crawler->filter('#page-body')->text()); + $this->assertStringNotContainsString('Re: Unapproved Posts Test Topic #1-#2', $crawler->filter('#page-body')->text()); $this->assert_forum_details($this->data['forums']['Unapproved Posts Test #1'], [ 'forum_posts_approved' => 1, @@ -99,7 +99,7 @@ class phpbb_functional_visibility_unapproved_test extends phpbb_functional_test_ $post = $this->create_topic($this->data['forums']['Unapproved Posts Test #1'], 'Unapproved Posts Test Topic #2', 'This is a test topic posted by the testing framework.', [], 'POST_STORED_MOD'); $crawler = self::request('GET', "viewforum.php?f={$this->data['forums']['Unapproved Posts Test #1']}&sid={$this->sid}"); - $this->assertNotContains('Unapproved Posts Test Topic #2', $crawler->filter('html')->text()); + $this->assertStringNotContainsString('Unapproved Posts Test Topic #2', $crawler->filter('html')->text()); $this->assert_forum_details($this->data['forums']['Unapproved Posts Test #1'], [ 'forum_posts_approved' => 1, @@ -149,13 +149,13 @@ class phpbb_functional_visibility_unapproved_test extends phpbb_functional_test_ // should be able to see topic 1 but not unapproved post $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Unapproved Posts Test Topic #1']}&sid={$this->sid}"); - $this->assertContains('Unapproved Posts Test Topic #1', $crawler->filter('h2')->text()); - $this->assertNotContains('Re: Unapproved Posts Test Topic #1-#2', $crawler->filter('#page-body')->text()); - $this->assertNotContains('This post is not visible to other users until it has been approved', $crawler->filter('#page-body')->text()); + $this->assertStringContainsString('Unapproved Posts Test Topic #1', $crawler->filter('h2')->text()); + $this->assertStringNotContainsString('Re: Unapproved Posts Test Topic #1-#2', $crawler->filter('#page-body')->text()); + $this->assertStringNotContainsString('This post is not visible to other users until it has been approved', $crawler->filter('#page-body')->text()); // should not be able to see topic 2 $crawler = self::request('GET', "viewforum.php?f={$this->data['forums']['Unapproved Posts Test #1']}&sid={$this->sid}"); - $this->assertNotContains('Unapproved Posts Test Topic #2', $crawler->filter('html')->text()); + $this->assertStringNotContainsString('Unapproved Posts Test Topic #2', $crawler->filter('html')->text()); $this->logout(); // another user @@ -166,13 +166,13 @@ class phpbb_functional_visibility_unapproved_test extends phpbb_functional_test_ // should be able to see topic 1 but not unapproved post $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Unapproved Posts Test Topic #1']}&sid={$this->sid}"); - $this->assertContains('Unapproved Posts Test Topic #1', $crawler->filter('h2')->text()); - $this->assertNotContains('Re: Unapproved Posts Test Topic #1-#2', $crawler->filter('#page-body')->text()); - $this->assertNotContains('This post is not visible to other users until it has been approved', $crawler->filter('#page-body')->text()); + $this->assertStringContainsString('Unapproved Posts Test Topic #1', $crawler->filter('h2')->text()); + $this->assertStringNotContainsString('Re: Unapproved Posts Test Topic #1-#2', $crawler->filter('#page-body')->text()); + $this->assertStringNotContainsString('This post is not visible to other users until it has been approved', $crawler->filter('#page-body')->text()); // should not be able to see topic 2 $crawler = self::request('GET', "viewforum.php?f={$this->data['forums']['Unapproved Posts Test #1']}&sid={$this->sid}"); - $this->assertNotContains('Unapproved Posts Test Topic #2', $crawler->filter('html')->text()); + $this->assertStringNotContainsString('Unapproved Posts Test Topic #2', $crawler->filter('html')->text()); } public function test_view_unapproved_post_enabled() @@ -212,18 +212,18 @@ class phpbb_functional_visibility_unapproved_test extends phpbb_functional_test_ // should be able to see topic 1 and unapproved post $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Unapproved Posts Test Topic #1']}&sid={$this->sid}"); - $this->assertContains('Unapproved Posts Test Topic #1', $crawler->filter('h2')->text()); - $this->assertContains('Re: Unapproved Posts Test Topic #1-#2', $crawler->filter('#page-body')->text()); - $this->assertContains('This post is not visible to other users until it has been approved', $crawler->filter('#page-body')->text()); + $this->assertStringContainsString('Unapproved Posts Test Topic #1', $crawler->filter('h2')->text()); + $this->assertStringContainsString('Re: Unapproved Posts Test Topic #1-#2', $crawler->filter('#page-body')->text()); + $this->assertStringContainsString('This post is not visible to other users until it has been approved', $crawler->filter('#page-body')->text()); // should be able to see topic 2 $crawler = self::request('GET', "viewforum.php?f={$this->data['forums']['Unapproved Posts Test #1']}&sid={$this->sid}"); - $this->assertContains('Unapproved Posts Test Topic #2', $crawler->filter('html')->text()); + $this->assertStringContainsString('Unapproved Posts Test Topic #2', $crawler->filter('html')->text()); // should be able to see post in topic 2 $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Unapproved Posts Test Topic #2']}&sid={$this->sid}"); - $this->assertContains('Unapproved Posts Test Topic #2', $crawler->filter('#page-body')->text()); - $this->assertContains('This post is not visible to other users until it has been approved', $crawler->filter('#page-body')->text()); + $this->assertStringContainsString('Unapproved Posts Test Topic #2', $crawler->filter('#page-body')->text()); + $this->assertStringContainsString('This post is not visible to other users until it has been approved', $crawler->filter('#page-body')->text()); $this->logout(); // another user @@ -235,13 +235,13 @@ class phpbb_functional_visibility_unapproved_test extends phpbb_functional_test_ // should be able to see topic 1 but not unapproved post $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Unapproved Posts Test Topic #1']}&sid={$this->sid}"); - $this->assertContains('Unapproved Posts Test Topic #1', $crawler->filter('h2')->text()); - $this->assertNotContains('Re: Unapproved Posts Test Topic #1-#2', $crawler->filter('#page-body')->text()); - $this->assertNotContains('This post is not visible to other users until it has been approved', $crawler->filter('#page-body')->text()); + $this->assertStringContainsString('Unapproved Posts Test Topic #1', $crawler->filter('h2')->text()); + $this->assertStringNotContainsString('Re: Unapproved Posts Test Topic #1-#2', $crawler->filter('#page-body')->text()); + $this->assertStringNotContainsString('This post is not visible to other users until it has been approved', $crawler->filter('#page-body')->text()); // should not be able to see topic 2 $crawler = self::request('GET', "viewforum.php?f={$this->data['forums']['Unapproved Posts Test #1']}&sid={$this->sid}"); - $this->assertNotContains('Unapproved Posts Test Topic #2', $crawler->filter('html')->text()); + $this->assertStringNotContainsString('Unapproved Posts Test Topic #2', $crawler->filter('html')->text()); $this->logout(); } diff --git a/tests/functional/visit_installer_test.php b/tests/functional/visit_installer_test.php index b4a75c0b51..742007fa5f 100644 --- a/tests/functional/visit_installer_test.php +++ b/tests/functional/visit_installer_test.php @@ -19,12 +19,12 @@ class phpbb_functional_visit_installer_test extends phpbb_functional_test_case public function test_visit_installer() { self::request('GET', 'install/', [], false); - $this->assertContains('', $this->get_content()); + $this->assertStringContainsString('', $this->get_content()); self::request('GET', 'install/index.html', [], false); - $this->assertContains('', $this->get_content()); + $this->assertStringContainsString('', $this->get_content()); self::request('GET', 'install/app.php'); - $this->assertContains('installation system', $this->get_content()); + $this->assertStringContainsString('installation system', $this->get_content()); } } diff --git a/tests/functions/get_remote_file_test.php b/tests/functions/get_remote_file_test.php index b783e3c297..c0330d01f8 100644 --- a/tests/functions/get_remote_file_test.php +++ b/tests/functions/get_remote_file_test.php @@ -74,7 +74,7 @@ class phpbb_functions_get_remote_file extends phpbb_test_case 'Failed asserting that the second line of the version file is a valid URL.' ); - $this->assertContains('http', $lines[1]); - $this->assertContains('phpbb.com', $lines[1], '', true); + $this->assertStringContainsString('http', $lines[1]); + $this->assertStringContainsString('phpbb.com', $lines[1], '', true); } } diff --git a/tests/network/ftp_fsock_pasv_epsv_test.php b/tests/network/ftp_fsock_pasv_epsv_test.php index 4ec21b6f75..876df09d1b 100644 --- a/tests/network/ftp_fsock_pasv_epsv_test.php +++ b/tests/network/ftp_fsock_pasv_epsv_test.php @@ -55,7 +55,7 @@ class phpbb_network_ftp_fsock_pasv_epsv_test extends phpbb_test_case { $this->markTestSkipped("Failed to connect to $hostname: $result"); } - $this->assertContains('debian', $o->_ls()); + $this->assertStringContainsString('debian', $o->_ls()); $o->_close(); } diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index d107ce47d1..4bc37e187f 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -787,7 +787,7 @@ class phpbb_functional_test_case extends phpbb_test_case $this->add_lang('ucp'); $crawler = self::request('GET', 'ucp.php'); - $this->assertContains($this->lang('LOGIN_EXPLAIN_UCP'), $crawler->filter('html')->text()); + $this->assertStringContainsString($this->lang('LOGIN_EXPLAIN_UCP'), $crawler->filter('html')->text()); $form = $crawler->selectButton($this->lang('LOGIN'))->form(); if ($autologin) @@ -795,7 +795,7 @@ class phpbb_functional_test_case extends phpbb_test_case $form['autologin']->tick(); } $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(); @@ -814,7 +814,7 @@ class phpbb_functional_test_case extends phpbb_test_case $this->add_lang('ucp'); $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); } @@ -835,7 +835,7 @@ class phpbb_functional_test_case extends phpbb_test_case } $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(); @@ -844,7 +844,7 @@ class phpbb_functional_test_case extends phpbb_test_case if (strpos($field, 'password_') === 0) { $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(); @@ -934,7 +934,7 @@ class phpbb_functional_test_case extends phpbb_test_case */ 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); } /** @@ -946,7 +946,7 @@ class phpbb_functional_test_case extends phpbb_test_case */ 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); } /* @@ -961,7 +961,7 @@ class phpbb_functional_test_case extends phpbb_test_case { // Any output before the doc type means there was an error $content = self::get_content(); - self::assertNotContains('[phpBB Debug]', $content); + self::assertStringNotContainsString('[phpBB Debug]', $content); self::assertStringStartsWith('assertContains($expected, $crawler->filter('html')->text()); + $this->assertStringContainsString($expected, $crawler->filter('html')->text()); } return null; } @@ -1206,7 +1206,7 @@ class phpbb_functional_test_case extends phpbb_test_case $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(); return $this->get_parameter_from_link($url, 'p'); @@ -1230,7 +1230,7 @@ class phpbb_functional_test_case extends phpbb_test_case self::$last_post_timestamp = time(); $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'])) {