diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-03-25 22:21:27 +0100 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-03-25 22:21:27 +0100 |
commit | 2ee65f177e4f7e09ad2287f14d564e7068d322fb (patch) | |
tree | 39075e87ea7927e20e8956824cb7c49bf626b178 /tests/lib/Calendar/Resource | |
parent | 3cf321fdfc4235a87015a9af2f59c63220016c65 (diff) | |
download | nextcloud-server-2ee65f177e4f7e09ad2287f14d564e7068d322fb.tar.gz nextcloud-server-2ee65f177e4f7e09ad2287f14d564e7068d322fb.zip |
Use the shorter phpunit syntax for mocked return values
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'tests/lib/Calendar/Resource')
-rw-r--r-- | tests/lib/Calendar/Resource/ManagerTest.php | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/lib/Calendar/Resource/ManagerTest.php b/tests/lib/Calendar/Resource/ManagerTest.php index 71679a86a8c..30b0e16c948 100644 --- a/tests/lib/Calendar/Resource/ManagerTest.php +++ b/tests/lib/Calendar/Resource/ManagerTest.php @@ -45,18 +45,18 @@ class ManagerTest extends TestCase { public function testRegisterUnregisterBackend() { $backend1 = $this->createMock(IBackend::class); - $backend1->method('getBackendIdentifier')->will($this->returnValue('backend_1')); + $backend1->method('getBackendIdentifier')->willReturn('backend_1'); $this->server->expects($this->at(0)) ->method('query') ->with('calendar_resource_backend1') - ->will($this->returnValue($backend1)); + ->willReturn($backend1); $backend2 = $this->createMock(IBackend::class); - $backend2->method('getBackendIdentifier')->will($this->returnValue('backend_2')); + $backend2->method('getBackendIdentifier')->willReturn('backend_2'); $this->server->expects($this->at(1)) ->method('query') ->with('calendar_resource_backend2') - ->will($this->returnValue($backend2)); + ->willReturn($backend2); $this->manager->registerBackend('calendar_resource_backend1'); $this->manager->registerBackend('calendar_resource_backend2'); @@ -74,18 +74,18 @@ class ManagerTest extends TestCase { public function testGetBackend() { $backend1 = $this->createMock(IBackend::class); - $backend1->method('getBackendIdentifier')->will($this->returnValue('backend_1')); + $backend1->method('getBackendIdentifier')->willReturn('backend_1'); $this->server->expects($this->at(0)) ->method('query') ->with('calendar_resource_backend1') - ->will($this->returnValue($backend1)); + ->willReturn($backend1); $backend2 = $this->createMock(IBackend::class); - $backend2->method('getBackendIdentifier')->will($this->returnValue('backend_2')); + $backend2->method('getBackendIdentifier')->willReturn('backend_2'); $this->server->expects($this->at(1)) ->method('query') ->with('calendar_resource_backend2') - ->will($this->returnValue($backend2)); + ->willReturn($backend2); $this->manager->registerBackend('calendar_resource_backend1'); $this->manager->registerBackend('calendar_resource_backend2'); @@ -96,18 +96,18 @@ class ManagerTest extends TestCase { public function testClear() { $backend1 = $this->createMock(IBackend::class); - $backend1->method('getBackendIdentifier')->will($this->returnValue('backend_1')); + $backend1->method('getBackendIdentifier')->willReturn('backend_1'); $this->server->expects($this->at(0)) ->method('query') ->with('calendar_resource_backend1') - ->will($this->returnValue($backend1)); + ->willReturn($backend1); $backend2 = $this->createMock(IBackend::class); - $backend2->method('getBackendIdentifier')->will($this->returnValue('backend_2')); + $backend2->method('getBackendIdentifier')->willReturn('backend_2'); $this->server->expects($this->at(1)) ->method('query') ->with('calendar_resource_backend2') - ->will($this->returnValue($backend2)); + ->willReturn($backend2); $this->manager->registerBackend('calendar_resource_backend1'); $this->manager->registerBackend('calendar_resource_backend2'); |