1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-10 10:44:20 +02:00

[ticket/16549] Move from assert[Not]Contains to assertString[Not]ContainsString

PHPBB3-16549
This commit is contained in:
rxu
2020-07-13 13:45:12 +07:00
parent 16d8698e1b
commit 58ea656fd8
49 changed files with 291 additions and 280 deletions

View File

@@ -793,7 +793,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)
@@ -801,7 +801,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();
@@ -820,7 +820,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);
}
@@ -841,7 +841,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();
@@ -850,7 +850,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();
@@ -940,7 +940,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);
}
/**
@@ -952,7 +952,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);
}
/*
@@ -967,7 +967,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('<!DOCTYPE', trim($content), 'Output found before DOCTYPE specification.');
if ($status_code !== false)
@@ -988,7 +988,7 @@ class phpbb_functional_test_case extends phpbb_test_case
{
// Any output before the xml opening means there was an error
$content = self::get_content();
self::assertNotContains('[phpBB Debug]', $content);
self::assertStringNotContainsString('[phpBB Debug]', $content);
self::assertStringStartsWith('<?xml', trim($content), 'Output found before XML specification.');
if ($status_code !== false)
@@ -1169,7 +1169,7 @@ class phpbb_functional_test_case extends phpbb_test_case
}
else
{
$this->assertContains($expected, $crawler->filter('html')->text());
$this->assertStringContainsString($expected, $crawler->filter('html')->text());
}
return null;
}
@@ -1212,7 +1212,7 @@ class phpbb_functional_test_case extends phpbb_test_case
$crawler = self::submit_message($posting_url, 'POST_NEW_PM', $form_data);
$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');
@@ -1236,7 +1236,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']))
{