From 0123cd0ae345ae6c90955ea79331a48f7c5cf95d Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Thu, 23 Jul 2020 13:36:32 +0200 Subject: Use assertStringContainsString instead of assertContains on strings Signed-off-by: Morris Jobke --- apps/dav/tests/unit/Command/ListCalendarsTest.php | 9 ++++----- apps/dav/tests/unit/Command/MoveCalendarTest.php | 8 ++++---- 2 files changed, 8 insertions(+), 9 deletions(-) (limited to 'apps/dav/tests') diff --git a/apps/dav/tests/unit/Command/ListCalendarsTest.php b/apps/dav/tests/unit/Command/ListCalendarsTest.php index b63a973668e..c7dae373c94 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); @@ -76,7 +75,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() { @@ -94,7 +93,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() { @@ -133,7 +132,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 a0567401727..750863175a2 100644 --- a/apps/dav/tests/unit/Command/MoveCalendarTest.php +++ b/apps/dav/tests/unit/Command/MoveCalendarTest.php @@ -121,7 +121,7 @@ class MoveCalendarTest extends TestCase { ]); } - + public function testMoveWithInexistantCalendar() { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('User has no calendar named . You can run occ dav:list-calendars to list calendars URIs for this user.'); @@ -148,7 +148,7 @@ class MoveCalendarTest extends TestCase { ]); } - + public function testMoveWithExistingDestinationCalendar() { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('User already has a calendar named .'); @@ -313,7 +313,7 @@ class MoveCalendarTest extends TestCase { 'destinationuid' => 'user2', ]); - $this->assertContains("[OK] Calendar was moved from user to ", $commandTester->getDisplay()); + $this->assertStringContainsString("[OK] Calendar was moved from user to ", $commandTester->getDisplay()); } public function testMoveWithDestinationNotPartOfGroupAndForce() { @@ -360,7 +360,7 @@ class MoveCalendarTest extends TestCase { '--force' => true ]); - $this->assertContains("[OK] Calendar was moved from user to ", $commandTester->getDisplay()); + $this->assertStringContainsString("[OK] Calendar was moved from user to ", $commandTester->getDisplay()); } public function dataTestMoveWithCalendarAlreadySharedToDestination(): array { -- cgit v1.2.3