diff options
author | Morris Jobke <hey@morrisjobke.de> | 2020-07-23 13:36:32 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2020-07-30 13:17:13 +0200 |
commit | 3904acfe932be26be71daf2ae047a144ac8b48c9 (patch) | |
tree | 2f9d28005d4f2a6ab2d0ea458bf20a98b57039f3 /apps/dav | |
parent | 403040255f36e97be523dbaff50627c76dee1a6d (diff) | |
download | nextcloud-server-3904acfe932be26be71daf2ae047a144ac8b48c9.tar.gz nextcloud-server-3904acfe932be26be71daf2ae047a144ac8b48c9.zip |
Use assertStringContainsString instead of assertContains on strings
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/dav')
-rw-r--r-- | apps/dav/tests/unit/Command/ListCalendarsTest.php | 9 | ||||
-rw-r--r-- | apps/dav/tests/unit/Command/MoveCalendarTest.php | 7 |
2 files changed, 7 insertions, 9 deletions
diff --git a/apps/dav/tests/unit/Command/ListCalendarsTest.php b/apps/dav/tests/unit/Command/ListCalendarsTest.php index 42e24be5cd3..9a6723860b9 100644 --- a/apps/dav/tests/unit/Command/ListCalendarsTest.php +++ b/apps/dav/tests/unit/Command/ListCalendarsTest.php @@ -63,7 +63,6 @@ class ListCalendarsTest extends TestCase { ); } - public function testWithBadUser() { $this->expectException(\InvalidArgumentException::class); @@ -77,7 +76,7 @@ class ListCalendarsTest extends TestCase { $commandTester->execute([ 'uid' => self::USERNAME, ]); - $this->assertContains("User <" . self::USERNAME . "> in unknown", $commandTester->getDisplay()); + $this->assertStringContainsString("User <" . self::USERNAME . "> in unknown", $commandTester->getDisplay()); } public function testWithCorrectUserWithNoCalendars() @@ -96,7 +95,7 @@ class ListCalendarsTest extends TestCase { $commandTester->execute([ 'uid' => self::USERNAME, ]); - $this->assertContains("User <" . self::USERNAME . "> has no calendars\n", $commandTester->getDisplay()); + $this->assertStringContainsString("User <" . self::USERNAME . "> has no calendars\n", $commandTester->getDisplay()); } public function dataExecute() @@ -137,7 +136,7 @@ class ListCalendarsTest extends TestCase { $commandTester->execute([ 'uid' => self::USERNAME, ]); - $this->assertContains($output, $commandTester->getDisplay()); - $this->assertNotContains(BirthdayService::BIRTHDAY_CALENDAR_URI, $commandTester->getDisplay()); + $this->assertStringContainsString($output, $commandTester->getDisplay()); + $this->assertStringNotContainsString(BirthdayService::BIRTHDAY_CALENDAR_URI, $commandTester->getDisplay()); } } diff --git a/apps/dav/tests/unit/Command/MoveCalendarTest.php b/apps/dav/tests/unit/Command/MoveCalendarTest.php index e286c4f292a..c537fcb63e7 100644 --- a/apps/dav/tests/unit/Command/MoveCalendarTest.php +++ b/apps/dav/tests/unit/Command/MoveCalendarTest.php @@ -121,7 +121,6 @@ class MoveCalendarTest extends TestCase { ]); } - public function testMoveWithInexistantCalendar() { $this->expectException(\InvalidArgumentException::class); @@ -149,7 +148,7 @@ class MoveCalendarTest extends TestCase { ]); } - + public function testMoveWithExistingDestinationCalendar() { $this->expectException(\InvalidArgumentException::class); @@ -319,7 +318,7 @@ class MoveCalendarTest extends TestCase { 'destinationuid' => 'user2', ]); - $this->assertContains("[OK] Calendar <personal> was moved from user <user> to <user2>", $commandTester->getDisplay()); + $this->assertStringContainsString("[OK] Calendar <personal> was moved from user <user> to <user2>", $commandTester->getDisplay()); } public function testMoveWithDestinationNotPartOfGroupAndForce() @@ -367,7 +366,7 @@ class MoveCalendarTest extends TestCase { '--force' => true ]); - $this->assertContains("[OK] Calendar <personal> was moved from user <user> to <user2>", $commandTester->getDisplay()); + $this->assertStringContainsString("[OK] Calendar <personal> was moved from user <user> to <user2>", $commandTester->getDisplay()); } public function dataTestMoveWithCalendarAlreadySharedToDestination(): array |