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/Security | |
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/Security')
-rw-r--r-- | tests/lib/Security/Bruteforce/ThrottlerTest.php | 4 | ||||
-rw-r--r-- | tests/lib/Security/CredentialsManagerTest.php | 2 | ||||
-rw-r--r-- | tests/lib/Security/TrustedDomainHelperTest.php | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/tests/lib/Security/Bruteforce/ThrottlerTest.php b/tests/lib/Security/Bruteforce/ThrottlerTest.php index 048540fb5a5..5e0db3bf24c 100644 --- a/tests/lib/Security/Bruteforce/ThrottlerTest.php +++ b/tests/lib/Security/Bruteforce/ThrottlerTest.php @@ -185,7 +185,7 @@ class ThrottlerTest extends TestCase { ->willReturn($enabled); $this->config->method('getAppValue') - ->will($this->returnCallback(function($app, $key, $default) use ($whitelists) { + ->willReturnCallback(function($app, $key, $default) use ($whitelists) { if ($app !== 'bruteForce') { return $default; } @@ -193,7 +193,7 @@ class ThrottlerTest extends TestCase { return $whitelists[$key]; } return $default; - })); + }); $this->assertSame( ($enabled === false) ? true : $isWhiteListed, diff --git a/tests/lib/Security/CredentialsManagerTest.php b/tests/lib/Security/CredentialsManagerTest.php index 0b93c704b5c..5ebcac7756a 100644 --- a/tests/lib/Security/CredentialsManagerTest.php +++ b/tests/lib/Security/CredentialsManagerTest.php @@ -54,7 +54,7 @@ class CredentialsManagerTest extends \Test\TestCase { $result->expects($this->any()) ->method('fetch') - ->will($this->returnValue($row)); + ->willReturn($row); return $result; } diff --git a/tests/lib/Security/TrustedDomainHelperTest.php b/tests/lib/Security/TrustedDomainHelperTest.php index f3ee14dead1..2796dead0e2 100644 --- a/tests/lib/Security/TrustedDomainHelperTest.php +++ b/tests/lib/Security/TrustedDomainHelperTest.php @@ -34,11 +34,11 @@ class TrustedDomainHelperTest extends \Test\TestCase { $this->config->expects($this->at(0)) ->method('getSystemValue') ->with('overwritehost') - ->will($this->returnValue('')); + ->willReturn(''); $this->config->expects($this->at(1)) ->method('getSystemValue') ->with('trusted_domains') - ->will($this->returnValue($trustedDomains)); + ->willReturn($trustedDomains); $trustedDomainHelper = new TrustedDomainHelper($this->config); $this->assertEquals($result, $trustedDomainHelper->isTrustedDomain($testDomain)); @@ -122,7 +122,7 @@ class TrustedDomainHelperTest extends \Test\TestCase { $this->config->expects($this->at(0)) ->method('getSystemValue') ->with('overwritehost') - ->will($this->returnValue('myproxyhost')); + ->willReturn('myproxyhost'); $trustedDomainHelper = new TrustedDomainHelper($this->config); $this->assertTrue($trustedDomainHelper->isTrustedDomain('myproxyhost')); |