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 /apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php | |
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 'apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php')
-rw-r--r-- | apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php index 35362da177c..d1e863b18ba 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php @@ -143,25 +143,25 @@ class FilesPluginTest extends TestCase { $node->expects($this->any()) ->method('getId') - ->will($this->returnValue(123)); + ->willReturn(123); $this->tree->expects($this->any()) ->method('getNodeForPath') ->with($path) - ->will($this->returnValue($node)); + ->willReturn($node); $node->expects($this->any()) ->method('getFileId') - ->will($this->returnValue('00000123instanceid')); + ->willReturn('00000123instanceid'); $node->expects($this->any()) ->method('getInternalFileId') - ->will($this->returnValue('123')); + ->willReturn('123'); $node->expects($this->any()) ->method('getEtag') - ->will($this->returnValue('"abc"')); + ->willReturn('"abc"'); $node->expects($this->any()) ->method('getDavPermissions') - ->will($this->returnValue('DWCKMSR')); + ->willReturn('DWCKMSR'); $fileInfo = $this->createMock(FileInfo::class); $fileInfo->expects($this->any()) @@ -200,18 +200,18 @@ class FilesPluginTest extends TestCase { $user ->expects($this->once()) ->method('getUID') - ->will($this->returnValue('foo')); + ->willReturn('foo'); $user ->expects($this->once()) ->method('getDisplayName') - ->will($this->returnValue('M. Foo')); + ->willReturn('M. Foo'); $node->expects($this->once()) ->method('getDirectDownload') - ->will($this->returnValue(array('url' => 'http://example.com/'))); + ->willReturn(array('url' => 'http://example.com/')); $node->expects($this->exactly(2)) ->method('getOwner') - ->will($this->returnValue($user)); + ->willReturn($user); $this->plugin->handleGetProperties( $propFind, @@ -277,7 +277,7 @@ class FilesPluginTest extends TestCase { $node = $this->createTestNode('\OCA\DAV\Connector\Sabre\File'); $node->expects($this->any()) ->method('getDavPermissions') - ->will($this->returnValue('DWCKMSR')); + ->willReturn('DWCKMSR'); $this->plugin->handleGetProperties( $propFind, @@ -306,7 +306,7 @@ class FilesPluginTest extends TestCase { $node->expects($this->once()) ->method('getSize') - ->will($this->returnValue(1025)); + ->willReturn(1025); $this->plugin->handleGetProperties( $propFind, @@ -402,7 +402,7 @@ class FilesPluginTest extends TestCase { $node->expects($this->once()) ->method('setEtag') ->with('newetag') - ->will($this->returnValue(true)); + ->willReturn(true); // properties to set $propPatch = new PropPatch(array( @@ -553,7 +553,7 @@ class FilesPluginTest extends TestCase { $request ->expects($this->once()) ->method('getPath') - ->will($this->returnValue('test/somefile.xml')); + ->willReturn('test/somefile.xml'); $node = $this->getMockBuilder(File::class) ->disableOriginalConstructor() @@ -561,18 +561,18 @@ class FilesPluginTest extends TestCase { $node ->expects($this->once()) ->method('getName') - ->will($this->returnValue('somefile.xml')); + ->willReturn('somefile.xml'); $this->tree ->expects($this->once()) ->method('getNodeForPath') ->with('test/somefile.xml') - ->will($this->returnValue($node)); + ->willReturn($node); $this->request ->expects($this->once()) ->method('isUserAgent') - ->will($this->returnValue($isClumsyAgent)); + ->willReturn($isClumsyAgent); $response ->expects($this->once()) @@ -596,7 +596,7 @@ class FilesPluginTest extends TestCase { $this->previewManager->expects($this->once()) ->method('isAvailable') - ->will($this->returnValue(false)); + ->willReturn(false); $this->plugin->handleGetProperties( $propFind, |