diff options
Diffstat (limited to 'apps/dav/tests/unit/CalDAV/CachedSubscriptionTest.php')
-rw-r--r-- | apps/dav/tests/unit/CalDAV/CachedSubscriptionTest.php | 52 |
1 files changed, 28 insertions, 24 deletions
diff --git a/apps/dav/tests/unit/CalDAV/CachedSubscriptionTest.php b/apps/dav/tests/unit/CalDAV/CachedSubscriptionTest.php index dac5090dccc..6b5b5f65347 100644 --- a/apps/dav/tests/unit/CalDAV/CachedSubscriptionTest.php +++ b/apps/dav/tests/unit/CalDAV/CachedSubscriptionTest.php @@ -141,7 +141,7 @@ class CachedSubscriptionTest extends \Test\TestCase { $calendar->propPatch($propPatch); } - + public function testGetChild() { $this->expectException(\Sabre\DAV\Exception\NotFound::class); $this->expectExceptionMessage('Calendar object not found'); @@ -154,17 +154,19 @@ class CachedSubscriptionTest extends \Test\TestCase { 'uri' => 'cal', ]; - $backend->expects($this->at(0)) + $backend->expects($this->exactly(2)) ->method('getCalendarObject') - ->with(666, 'foo1', 1) - ->willReturn([ - 'id' => 99, - 'uri' => 'foo1' - ]); - $backend->expects($this->at(1)) - ->method('getCalendarObject') - ->with(666, 'foo2', 1) - ->willReturn(null); + ->withConsecutive( + [666, 'foo1', 1], + [666, 'foo2', 1], + ) + ->willReturnOnConsecutiveCalls( + [ + 'id' => 99, + 'uri' => 'foo1' + ], + null + ); $calendar = new CachedSubscription($backend, $calendarInfo); @@ -183,7 +185,7 @@ class CachedSubscriptionTest extends \Test\TestCase { 'uri' => 'cal', ]; - $backend->expects($this->at(0)) + $backend->expects($this->once()) ->method('getCalendarObjects') ->with(666, 1) ->willReturn([ @@ -214,7 +216,7 @@ class CachedSubscriptionTest extends \Test\TestCase { 'uri' => 'cal', ]; - $backend->expects($this->at(0)) + $backend->expects($this->once()) ->method('getMultipleCalendarObjects') ->with(666, ['foo1', 'foo2'], 1) ->willReturn([ @@ -236,7 +238,7 @@ class CachedSubscriptionTest extends \Test\TestCase { $this->assertInstanceOf(CachedSubscriptionObject::class, $res[1]); } - + public function testCreateFile() { $this->expectException(\Sabre\DAV\Exception\MethodNotAllowed::class); $this->expectExceptionMessage('Creating objects in cached subscription is not allowed'); @@ -262,17 +264,19 @@ class CachedSubscriptionTest extends \Test\TestCase { 'uri' => 'cal', ]; - $backend->expects($this->at(0)) - ->method('getCalendarObject') - ->with(666, 'foo1', 1) - ->willReturn([ - 'id' => 99, - 'uri' => 'foo1' - ]); - $backend->expects($this->at(1)) + $backend->expects($this->exactly(2)) ->method('getCalendarObject') - ->with(666, 'foo2', 1) - ->willReturn(null); + ->withConsecutive( + [666, 'foo1', 1], + [666, 'foo2', 1], + ) + ->willReturnOnConsecutiveCalls( + [ + 'id' => 99, + 'uri' => 'foo1' + ], + null + ); $calendar = new CachedSubscription($backend, $calendarInfo); |