summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-07-23 13:36:32 +0200
committerMorris Jobke <hey@morrisjobke.de>2020-07-23 17:11:29 +0200
commit0123cd0ae345ae6c90955ea79331a48f7c5cf95d (patch)
tree55d14965b30c6bf23cd200c26ec663a93767f910 /apps
parentf8955bd0d1fe3e51d88831bc4f4c934bdef1256a (diff)
downloadnextcloud-server-0123cd0ae345ae6c90955ea79331a48f7c5cf95d.tar.gz
nextcloud-server-0123cd0ae345ae6c90955ea79331a48f7c5cf95d.zip
Use assertStringContainsString instead of assertContains on strings
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/tests/unit/Command/ListCalendarsTest.php9
-rw-r--r--apps/dav/tests/unit/Command/MoveCalendarTest.php8
2 files changed, 8 insertions, 9 deletions
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 <user> has no calendar named <personal>. 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 <user2> already has a calendar named <personal>.');
@@ -313,7 +313,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() {
@@ -360,7 +360,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 {