This email was sent using the CakePHP Framework
'; - $this->assertContains($expected, $this->CakeEmail->message(CakeEmail::MESSAGE_HTML)); + $this->assertStringContainsString($expected, $this->CakeEmail->message(CakeEmail::MESSAGE_HTML)); $expected = 'This email was sent using the CakePHP Framework, https://cakephp.org.'; - $this->assertContains($expected, $this->CakeEmail->message(CakeEmail::MESSAGE_TEXT)); + $this->assertStringContainsString($expected, $this->CakeEmail->message(CakeEmail::MESSAGE_TEXT)); $message = $this->CakeEmail->message(); $this->assertContains('Content-Type: text/plain; charset=UTF-8', $message); @@ -2134,11 +2134,11 @@ class CakeEmailTest extends CakeTestCase { $email->subject('あれ?もしかしての前と'); $headers = $email->getHeaders(array('subject')); $expected = "?ISO-2022-JP?B?GyRCJCIkbCEpJGIkNyQrJDckRiROQTAkSBsoQg==?="; - $this->assertContains($expected, $headers['Subject']); + $this->assertStringContainsString($expected, $headers['Subject']); $email->to('someone@example.com')->from('someone@example.com'); $result = $email->send('ってテーブルを作ってやってたらう'); - $this->assertContains('ってテーブルを作ってやってたらう', $result['message']); + $this->assertStringContainsString('ってテーブルを作ってやってたらう', $result['message']); } /** @@ -2156,12 +2156,12 @@ class CakeEmailTest extends CakeTestCase { $email->subject('あれ?もしかしての前と'); $headers = $email->getHeaders(array('subject')); $expected = "?ISO-2022-JP?B?GyRCJCIkbCEpJGIkNyQrJDckRiROQTAkSBsoQg==?="; - $this->assertContains($expected, $headers['Subject']); + $this->assertStringContainsString($expected, $headers['Subject']); $email->to('someone@example.com')->from('someone@example.com'); $result = $email->send('ってテーブルを作ってやってたらう'); - $this->assertContains('Content-Type: text/plain; charset=ISO-2022-JP', $result['headers']); - $this->assertContains(mb_convert_encoding('ってテーブルを作ってやってたらう', 'ISO-2022-JP'), $result['message']); + $this->assertStringContainsString('Content-Type: text/plain; charset=ISO-2022-JP', $result['headers']); + $this->assertStringContainsString(mb_convert_encoding('ってテーブルを作ってやってたらう', 'ISO-2022-JP'), $result['message']); } /** @@ -2179,7 +2179,7 @@ class CakeEmailTest extends CakeTestCase { $email->subject('あれ?もしかしての前と'); $headers = $email->getHeaders(array('subject')); $expected = "?ISO-2022-JP?B?GyRCJCIkbCEpJGIkNyQrJDckRiROQTAkSBsoQg==?="; - $this->assertContains($expected, $headers['Subject']); + $this->assertStringContainsString($expected, $headers['Subject']); $email->to('someone@example.com')->from('someone@example.com'); $result = $email->send('①㈱'); @@ -2203,13 +2203,13 @@ class CakeEmailTest extends CakeTestCase { $email->subject('あれ?もしかしての前と'); $headers = $email->getHeaders(array('subject')); $expected = "?ISO-2022-JP?B?GyRCJCIkbCEpJGIkNyQrJDckRiROQTAkSBsoQg==?="; - $this->assertContains($expected, $headers['Subject']); + $this->assertStringContainsString($expected, $headers['Subject']); $email->to('someone@example.com')->from('someone@example.com'); $result = $email->send('①㈱'); $this->assertTextContains("Content-Type: text/plain; charset=ISO-2022-JP", $result['headers']); $this->assertTextNotContains("Content-Type: text/plain; charset=iso-2022-jp-ms", $result['headers']); // not charset=iso-2022-jp-ms - $this->assertContains(mb_convert_encoding('①㈱', 'ISO-2022-JP-MS'), $result['message']); + $this->assertStringContainsString(mb_convert_encoding('①㈱', 'ISO-2022-JP-MS'), $result['message']); } protected function _checkContentTransferEncoding($message, $charset) { @@ -2550,8 +2550,8 @@ HTML; $this->CakeEmail->emailFormat('html'); $this->CakeEmail->template('long_line', null); $result = $this->CakeEmail->send(); - $this->assertContains('', $result['message'], 'First bits are included'); - $this->assertContains('x', $result['message'], 'Last byte are included'); + $this->assertStringContainsString('', $result['message'], 'First bits are included'); + $this->assertStringContainsString('x', $result['message'], 'Last byte are included'); } /** diff --git a/lib/Cake/Test/Case/Network/Email/MailTransportTest.php b/lib/Cake/Test/Case/Network/Email/MailTransportTest.php index 6019b960c..f9e0c4ba3 100644 --- a/lib/Cake/Test/Case/Network/Email/MailTransportTest.php +++ b/lib/Cake/Test/Case/Network/Email/MailTransportTest.php @@ -86,8 +86,8 @@ class MailTransportTest extends CakeTestCase { $result = $this->MailTransport->send($email); - $this->assertContains('Subject: ', $result['headers']); - $this->assertContains('To: ', $result['headers']); + $this->assertStringContainsString('Subject: ', $result['headers']); + $this->assertStringContainsString('To: ', $result['headers']); } } diff --git a/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php b/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php index 054a6db6e..27c692444 100644 --- a/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php +++ b/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php @@ -594,7 +594,7 @@ class HttpSocketTest extends CakeTestCase { 'method' => 'GET' ); $this->Socket->request($request); - $this->assertContains('Host: cakephp.org:8080', $this->Socket->request['header']); + $this->assertStringContainsString('Host: cakephp.org:8080', $this->Socket->request['header']); } /** @@ -618,7 +618,7 @@ class HttpSocketTest extends CakeTestCase { 'method' => 'GET' ); $this->Socket->request($request); - $this->assertContains("GET /index.php?somestring HTTP/1.1", $this->Socket->request['line']); + $this->assertStringContainsString("GET /index.php?somestring HTTP/1.1", $this->Socket->request['line']); } /** @@ -1845,7 +1845,7 @@ class HttpSocketTest extends CakeTestCase { } catch (SocketException $e) { $message = $e->getMessage(); $this->skipIf(strpos($message, 'Invalid HTTP') !== false, 'Invalid HTTP Response received, skipping.'); - $this->assertContains('Failed to enable crypto', $message); + $this->assertStringContainsString('Failed to enable crypto', $message); } } diff --git a/lib/Cake/Test/Case/TestSuite/CakeTestCaseTest.php b/lib/Cake/Test/Case/TestSuite/CakeTestCaseTest.php index de58df0cf..f7adc7208 100644 --- a/lib/Cake/Test/Case/TestSuite/CakeTestCaseTest.php +++ b/lib/Cake/Test/Case/TestSuite/CakeTestCaseTest.php @@ -380,7 +380,7 @@ class CakeTestCaseTest extends CakeTestCase { */ public function testAssertTextContains() { $stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!"; - $this->assertContains("different", $stringDirty); + $this->assertStringContainsString("different", $stringDirty); $this->assertNotContains("different\rline", $stringDirty); $this->assertTextContains("different\rline", $stringDirty); } diff --git a/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php b/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php index 3c837a2d8..77671f6e1 100644 --- a/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php +++ b/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php @@ -602,24 +602,24 @@ class ControllerTestCaseTest extends CakeTestCase { 'method' => 'get', 'return' => 'contents', )); - $this->assertContains('assertContains('This is the TestsAppsController index view', $result); - $this->assertContains('first call', $result); - $this->assertContains('', $result); + $this->assertStringContainsString('assertStringContainsString('This is the TestsAppsController index view', $result); + $this->assertStringContainsString('first call', $result); + $this->assertStringContainsString('', $result); $result = $this->Case->testAction('/tests_apps/index', array( 'data' => array('var' => 'second call'), 'method' => 'get', 'return' => 'contents' )); - $this->assertContains('second call', $result); + $this->assertStringContainsString('second call', $result); $result = $this->Case->testAction('/tests_apps/index', array( 'data' => array('var' => 'third call'), 'method' => 'get', 'return' => 'contents' )); - $this->assertContains('third call', $result); + $this->assertStringContainsString('third call', $result); } /** diff --git a/lib/Cake/Test/Case/Utility/DebuggerTest.php b/lib/Cake/Test/Case/Utility/DebuggerTest.php index fd96c0e62..7d7a96457 100644 --- a/lib/Cake/Test/Case/Utility/DebuggerTest.php +++ b/lib/Cake/Test/Case/Utility/DebuggerTest.php @@ -152,7 +152,7 @@ class DebuggerTest extends CakeTestCase { $this->assertMatchesRegularExpression('/Undefined variable:\s+buzz/', $result[1]); $this->assertMatchesRegularExpression('/]+>Code/', $result[1]); $this->assertMatchesRegularExpression('/]+>Context/', $result[2]); - $this->assertContains('$wrong = ''', $result[3], 'Context should be HTML escaped.'); + $this->assertStringContainsString('$wrong = ''', $result[3], 'Context should be HTML escaped.'); } /** @@ -170,7 +170,7 @@ class DebuggerTest extends CakeTestCase { $result = ob_get_clean(); $this->assertNotContains('