diff --git a/tests/legacy/ApiTest.php b/tests/legacy/ApiTest.php index 6dd4066898..837b7409b0 100644 --- a/tests/legacy/ApiTest.php +++ b/tests/legacy/ApiTest.php @@ -189,7 +189,7 @@ class ApiTest extends FixtureTest private function assertXml($result = '', $root_element = '') { self::assertStringStartsWith('', $result); - self::assertContains('<' . $root_element, $result); + self::assertStringContainsString('<' . $root_element, $result); // We could probably do more checks here. } @@ -1505,7 +1505,7 @@ class ApiTest extends FixtureTest $result = api_search('json'); foreach ($result['status'] as $status) { self::assertStatus($status); - self::assertContains('reply', $status['text'], '', true); + self::assertStringContainsStringIgnoringCase('reply', $status['text'], '', true); } } @@ -1521,7 +1521,7 @@ class ApiTest extends FixtureTest $result = api_search('json'); foreach ($result['status'] as $status) { self::assertStatus($status); - self::assertContains('reply', $status['text'], '', true); + self::assertStringContainsStringIgnoringCase('reply', $status['text'], '', true); } } @@ -1537,7 +1537,7 @@ class ApiTest extends FixtureTest $result = api_search('json'); foreach ($result['status'] as $status) { self::assertStatus($status); - self::assertContains('reply', $status['text'], '', true); + self::assertStringContainsStringIgnoringCase('reply', $status['text'], '', true); } } @@ -1551,7 +1551,7 @@ class ApiTest extends FixtureTest $result = api_search('json'); foreach ($result['status'] as $status) { self::assertStatus($status); - self::assertContains('#friendica', $status['text'], '', true); + self::assertStringContainsStringIgnoringCase('#friendica', $status['text'], '', true); } } @@ -2874,7 +2874,7 @@ class ApiTest extends FixtureTest $_POST['text'] = 'message_text'; $_POST['screen_name'] = $this->friendUser['nick']; $result = api_direct_messages_new('json'); - self::assertContains('message_text', $result['direct_message']['text']); + self::assertStringContainsString('message_text', $result['direct_message']['text']); self::assertEquals('selfcontact', $result['direct_message']['sender_screen_name']); self::assertEquals(1, $result['direct_message']['friendica_seen']); } @@ -2891,8 +2891,8 @@ class ApiTest extends FixtureTest $_POST['screen_name'] = $this->friendUser['nick']; $_REQUEST['title'] = 'message_title'; $result = api_direct_messages_new('json'); - self::assertContains('message_text', $result['direct_message']['text']); - self::assertContains('message_title', $result['direct_message']['text']); + self::assertStringContainsString('message_text', $result['direct_message']['text']); + self::assertStringContainsString('message_title', $result['direct_message']['text']); self::assertEquals('selfcontact', $result['direct_message']['sender_screen_name']); self::assertEquals(1, $result['direct_message']['friendica_seen']); } diff --git a/tests/src/Util/EMailerTest.php b/tests/src/Util/EMailerTest.php index 3b1c3cc1f3..7f96e010a5 100644 --- a/tests/src/Util/EMailerTest.php +++ b/tests/src/Util/EMailerTest.php @@ -78,16 +78,16 @@ class EMailerTest extends MockedTest self::assertTrue($emailer->send($testEmail)); - self::assertContains("X-Friendica-Host: friendica.local", EmailerSpy::$MAIL_DATA['headers']); - self::assertContains("X-Friendica-Platform: Friendica", EmailerSpy::$MAIL_DATA['headers']); - self::assertContains("List-ID: ", EmailerSpy::$MAIL_DATA['headers']); - self::assertContains("List-Archive: ", EmailerSpy::$MAIL_DATA['headers']); - self::assertContains("Reply-To: Sender ", EmailerSpy::$MAIL_DATA['headers']); - self::assertContains("MIME-Version: 1.0", EmailerSpy::$MAIL_DATA['headers']); + self::assertStringContainsString("X-Friendica-Host: friendica.local", EmailerSpy::$MAIL_DATA['headers']); + self::assertStringContainsString("X-Friendica-Platform: Friendica", EmailerSpy::$MAIL_DATA['headers']); + self::assertStringContainsString("List-ID: ", EmailerSpy::$MAIL_DATA['headers']); + self::assertStringContainsString("List-Archive: ", EmailerSpy::$MAIL_DATA['headers']); + self::assertStringContainsString("Reply-To: Sender ", EmailerSpy::$MAIL_DATA['headers']); + self::assertStringContainsString("MIME-Version: 1.0", EmailerSpy::$MAIL_DATA['headers']); // Base64 "Test Text" - self::assertContains(chunk_split(base64_encode('Test Text')), EmailerSpy::$MAIL_DATA['body']); + self::assertStringContainsString(chunk_split(base64_encode('Test Text')), EmailerSpy::$MAIL_DATA['body']); // Base64 "Test MessageBold" - self::assertContains(chunk_split(base64_encode("Test MessageBold")), EmailerSpy::$MAIL_DATA['body']); + self::assertStringContainsString(chunk_split(base64_encode("Test MessageBold")), EmailerSpy::$MAIL_DATA['body']); self::assertEquals("Test Subject", EmailerSpy::$MAIL_DATA['subject']); self::assertEquals("recipient@friendica.local", EmailerSpy::$MAIL_DATA['to']); self::assertEquals("-f sender@friendica.local", EmailerSpy::$MAIL_DATA['parameters']); diff --git a/tests/src/Util/Logger/AbstractLoggerTest.php b/tests/src/Util/Logger/AbstractLoggerTest.php index 44e210b9ca..d008f4dc42 100644 --- a/tests/src/Util/Logger/AbstractLoggerTest.php +++ b/tests/src/Util/Logger/AbstractLoggerTest.php @@ -106,8 +106,8 @@ abstract class AbstractLoggerTest extends MockedTest $logger->emergency('A {psr} test', ['psr' => 'working']); $logger->alert('An {array} test', ['array' => ['it', 'is', 'working']]); $text = $this->getContent(); - self::assertContains('A working test', $text); - self::assertContains('An ["it","is","working"] test', $text); + self::assertStringContainsString('A working test', $text); + self::assertStringContainsString('An ["it","is","working"] test', $text); } /** @@ -119,9 +119,9 @@ abstract class AbstractLoggerTest extends MockedTest $logger->emergency('A test'); $text = $this->getContent(); - self::assertContains('"file":"' . self::FILE . '"', $text); - self::assertContains('"line":' . self::LINE, $text); - self::assertContains('"function":"' . self::FUNC . '"', $text); + self::assertStringContainsString('"file":"' . self::FILE . '"', $text); + self::assertStringContainsString('"line":' . self::LINE, $text); + self::assertStringContainsString('"function":"' . self::FUNC . '"', $text); } /** @@ -157,7 +157,7 @@ abstract class AbstractLoggerTest extends MockedTest self::assertLogline($text); - self::assertContains(@json_encode($context), $text); + self::assertStringContainsString(@json_encode($context), $text); } /** @@ -176,7 +176,7 @@ abstract class AbstractLoggerTest extends MockedTest self::assertLogline($text); - self::assertContains(@json_encode($assertion), $this->getContent()); + self::assertStringContainsString(@json_encode($assertion), $this->getContent()); } public function testNoObjectHandling() @@ -187,6 +187,6 @@ abstract class AbstractLoggerTest extends MockedTest self::assertLogline($text); - self::assertContains('test', $this->getContent()); + self::assertStringContainsString('test', $this->getContent()); } }