From 2ee65f177e4f7e09ad2287f14d564e7068d322fb Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Wed, 25 Mar 2020 22:21:27 +0100 Subject: Use the shorter phpunit syntax for mocked return values Signed-off-by: Christoph Wurst --- tests/lib/Security/Bruteforce/ThrottlerTest.php | 4 ++-- tests/lib/Security/CredentialsManagerTest.php | 2 +- tests/lib/Security/TrustedDomainHelperTest.php | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/lib/Security') 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')); -- cgit v1.2.3