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/Command | |
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/Command')
-rw-r--r-- | tests/lib/Command/Integrity/SignAppTest.php | 48 | ||||
-rw-r--r-- | tests/lib/Command/Integrity/SignCoreTest.php | 36 |
2 files changed, 42 insertions, 42 deletions
diff --git a/tests/lib/Command/Integrity/SignAppTest.php b/tests/lib/Command/Integrity/SignAppTest.php index 6fa86a2e855..594d17168d6 100644 --- a/tests/lib/Command/Integrity/SignAppTest.php +++ b/tests/lib/Command/Integrity/SignAppTest.php @@ -59,17 +59,17 @@ class SignAppTest extends TestCase { ->expects($this->at(0)) ->method('getOption') ->with('path') - ->will($this->returnValue(null)); + ->willReturn(null); $inputInterface ->expects($this->at(1)) ->method('getOption') ->with('privateKey') - ->will($this->returnValue('PrivateKey')); + ->willReturn('PrivateKey'); $inputInterface ->expects($this->at(2)) ->method('getOption') ->with('certificate') - ->will($this->returnValue('Certificate')); + ->willReturn('Certificate'); $outputInterface ->expects($this->at(0)) @@ -87,17 +87,17 @@ class SignAppTest extends TestCase { ->expects($this->at(0)) ->method('getOption') ->with('path') - ->will($this->returnValue('AppId')); + ->willReturn('AppId'); $inputInterface ->expects($this->at(1)) ->method('getOption') ->with('privateKey') - ->will($this->returnValue(null)); + ->willReturn(null); $inputInterface ->expects($this->at(2)) ->method('getOption') ->with('certificate') - ->will($this->returnValue('Certificate')); + ->willReturn('Certificate'); $outputInterface ->expects($this->at(0)) @@ -115,17 +115,17 @@ class SignAppTest extends TestCase { ->expects($this->at(0)) ->method('getOption') ->with('path') - ->will($this->returnValue('AppId')); + ->willReturn('AppId'); $inputInterface ->expects($this->at(1)) ->method('getOption') ->with('privateKey') - ->will($this->returnValue('privateKey')); + ->willReturn('privateKey'); $inputInterface ->expects($this->at(2)) ->method('getOption') ->with('certificate') - ->will($this->returnValue(null)); + ->willReturn(null); $outputInterface ->expects($this->at(0)) @@ -143,23 +143,23 @@ class SignAppTest extends TestCase { ->expects($this->at(0)) ->method('getOption') ->with('path') - ->will($this->returnValue('AppId')); + ->willReturn('AppId'); $inputInterface ->expects($this->at(1)) ->method('getOption') ->with('privateKey') - ->will($this->returnValue('privateKey')); + ->willReturn('privateKey'); $inputInterface ->expects($this->at(2)) ->method('getOption') ->with('certificate') - ->will($this->returnValue('certificate')); + ->willReturn('certificate'); $this->fileAccessHelper ->expects($this->at(0)) ->method('file_get_contents') ->with('privateKey') - ->will($this->returnValue(false)); + ->willReturn(false); $outputInterface ->expects($this->at(0)) @@ -177,28 +177,28 @@ class SignAppTest extends TestCase { ->expects($this->at(0)) ->method('getOption') ->with('path') - ->will($this->returnValue('AppId')); + ->willReturn('AppId'); $inputInterface ->expects($this->at(1)) ->method('getOption') ->with('privateKey') - ->will($this->returnValue('privateKey')); + ->willReturn('privateKey'); $inputInterface ->expects($this->at(2)) ->method('getOption') ->with('certificate') - ->will($this->returnValue('certificate')); + ->willReturn('certificate'); $this->fileAccessHelper ->expects($this->at(0)) ->method('file_get_contents') ->with('privateKey') - ->will($this->returnValue(\OC::$SERVERROOT . '/tests/data/integritycheck/core.key')); + ->willReturn(\OC::$SERVERROOT . '/tests/data/integritycheck/core.key'); $this->fileAccessHelper ->expects($this->at(1)) ->method('file_get_contents') ->with('certificate') - ->will($this->returnValue(false)); + ->willReturn(false); $outputInterface ->expects($this->at(0)) @@ -216,17 +216,17 @@ class SignAppTest extends TestCase { ->expects($this->at(0)) ->method('getOption') ->with('path') - ->will($this->returnValue('AppId')); + ->willReturn('AppId'); $inputInterface ->expects($this->at(1)) ->method('getOption') ->with('privateKey') - ->will($this->returnValue('privateKey')); + ->willReturn('privateKey'); $inputInterface ->expects($this->at(2)) ->method('getOption') ->with('certificate') - ->will($this->returnValue('certificate')); + ->willReturn('certificate'); $this->fileAccessHelper ->expects($this->at(0)) @@ -260,17 +260,17 @@ class SignAppTest extends TestCase { ->expects($this->at(0)) ->method('getOption') ->with('path') - ->will($this->returnValue('AppId')); + ->willReturn('AppId'); $inputInterface ->expects($this->at(1)) ->method('getOption') ->with('privateKey') - ->will($this->returnValue('privateKey')); + ->willReturn('privateKey'); $inputInterface ->expects($this->at(2)) ->method('getOption') ->with('certificate') - ->will($this->returnValue('certificate')); + ->willReturn('certificate'); $this->fileAccessHelper ->expects($this->at(0)) diff --git a/tests/lib/Command/Integrity/SignCoreTest.php b/tests/lib/Command/Integrity/SignCoreTest.php index 9bab016ec8f..36376ef0e7d 100644 --- a/tests/lib/Command/Integrity/SignCoreTest.php +++ b/tests/lib/Command/Integrity/SignCoreTest.php @@ -54,12 +54,12 @@ class SignCoreTest extends TestCase { ->expects($this->at(0)) ->method('getOption') ->with('privateKey') - ->will($this->returnValue(null)); + ->willReturn(null); $inputInterface ->expects($this->at(1)) ->method('getOption') ->with('certificate') - ->will($this->returnValue('Certificate')); + ->willReturn('Certificate'); $outputInterface ->expects($this->at(0)) @@ -77,12 +77,12 @@ class SignCoreTest extends TestCase { ->expects($this->at(0)) ->method('getOption') ->with('privateKey') - ->will($this->returnValue('privateKey')); + ->willReturn('privateKey'); $inputInterface ->expects($this->at(1)) ->method('getOption') ->with('certificate') - ->will($this->returnValue(null)); + ->willReturn(null); $outputInterface ->expects($this->at(0)) @@ -100,23 +100,23 @@ class SignCoreTest extends TestCase { ->expects($this->at(0)) ->method('getOption') ->with('privateKey') - ->will($this->returnValue('privateKey')); + ->willReturn('privateKey'); $inputInterface ->expects($this->at(1)) ->method('getOption') ->with('certificate') - ->will($this->returnValue('certificate')); + ->willReturn('certificate'); $inputInterface ->expects($this->at(2)) ->method('getOption') ->with('path') - ->will($this->returnValue('certificate')); + ->willReturn('certificate'); $this->fileAccessHelper ->expects($this->at(0)) ->method('file_get_contents') ->with('privateKey') - ->will($this->returnValue(false)); + ->willReturn(false); $outputInterface ->expects($this->at(0)) @@ -134,17 +134,17 @@ class SignCoreTest extends TestCase { ->expects($this->at(0)) ->method('getOption') ->with('privateKey') - ->will($this->returnValue('privateKey')); + ->willReturn('privateKey'); $inputInterface ->expects($this->at(1)) ->method('getOption') ->with('certificate') - ->will($this->returnValue('certificate')); + ->willReturn('certificate'); $inputInterface ->expects($this->at(2)) ->method('getOption') ->with('path') - ->will($this->returnValue('certificate')); + ->willReturn('certificate'); $this->fileAccessHelper ->expects($this->at(0)) @@ -155,7 +155,7 @@ class SignCoreTest extends TestCase { ->expects($this->at(1)) ->method('file_get_contents') ->with('certificate') - ->will($this->returnValue(false)); + ->willReturn(false); $outputInterface ->expects($this->at(0)) @@ -173,17 +173,17 @@ class SignCoreTest extends TestCase { ->expects($this->at(0)) ->method('getOption') ->with('privateKey') - ->will($this->returnValue('privateKey')); + ->willReturn('privateKey'); $inputInterface ->expects($this->at(1)) ->method('getOption') ->with('certificate') - ->will($this->returnValue('certificate')); + ->willReturn('certificate'); $inputInterface ->expects($this->at(2)) ->method('getOption') ->with('path') - ->will($this->returnValue('certificate')); + ->willReturn('certificate'); $this->fileAccessHelper ->expects($this->at(0)) @@ -217,17 +217,17 @@ class SignCoreTest extends TestCase { ->expects($this->at(0)) ->method('getOption') ->with('privateKey') - ->will($this->returnValue('privateKey')); + ->willReturn('privateKey'); $inputInterface ->expects($this->at(1)) ->method('getOption') ->with('certificate') - ->will($this->returnValue('certificate')); + ->willReturn('certificate'); $inputInterface ->expects($this->at(2)) ->method('getOption') ->with('path') - ->will($this->returnValue('certificate')); + ->willReturn('certificate'); $this->fileAccessHelper ->expects($this->at(0)) |