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/Controller/ThemingControllerTest.php | 40 +++++++++++----------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'apps/theming/tests') diff --git a/apps/theming/tests/Controller/ThemingControllerTest.php b/apps/theming/tests/Controller/ThemingControllerTest.php index 8c5f111acee..d6f8ff4c6b0 100644 --- a/apps/theming/tests/Controller/ThemingControllerTest.php +++ b/apps/theming/tests/Controller/ThemingControllerTest.php @@ -153,9 +153,9 @@ class ThemingControllerTest extends TestCase { $this->l10n ->expects($this->once()) ->method('t') - ->will($this->returnCallback(function($str) { + ->willReturnCallback(function($str) { return $str; - })); + }); $this->scssCacher ->expects($this->once()) ->method('getCachedSCSS') @@ -212,9 +212,9 @@ class ThemingControllerTest extends TestCase { $this->l10n ->expects($this->any()) ->method('t') - ->will($this->returnCallback(function($str) { + ->willReturnCallback(function($str) { return $str; - })); + }); $expected = new DataResponse( [ @@ -243,9 +243,9 @@ class ThemingControllerTest extends TestCase { $this->l10n ->expects($this->any()) ->method('t') - ->will($this->returnCallback(function($str) { + ->willReturnCallback(function($str) { return $str; - })); + }); $expected = new DataResponse( [ @@ -291,9 +291,9 @@ class ThemingControllerTest extends TestCase { $this->l10n ->expects($this->any()) ->method('t') - ->will($this->returnCallback(function($str) { + ->willReturnCallback(function($str) { return $str; - })); + }); $folder = $this->createMock(ISimpleFolder::class); $this->appData @@ -335,9 +335,9 @@ class ThemingControllerTest extends TestCase { $this->l10n ->expects($this->any()) ->method('t') - ->will($this->returnCallback(function($str) { + ->willReturnCallback(function($str) { return $str; - })); + }); $folder = $this->createMock(ISimpleFolder::class); $this->appData @@ -396,9 +396,9 @@ class ThemingControllerTest extends TestCase { $this->l10n ->expects($this->any()) ->method('t') - ->will($this->returnCallback(function($str) { + ->willReturnCallback(function($str) { return $str; - })); + }); $file = $this->createMock(ISimpleFile::class); @@ -472,9 +472,9 @@ class ThemingControllerTest extends TestCase { $this->l10n ->expects($this->any()) ->method('t') - ->will($this->returnCallback(function($str) { + ->willReturnCallback(function($str) { return $str; - })); + }); $file = $this->createMock(ISimpleFile::class); $folder = $this->createMock(ISimpleFolder::class); @@ -546,9 +546,9 @@ class ThemingControllerTest extends TestCase { $this->l10n ->expects($this->any()) ->method('t') - ->will($this->returnCallback(function($str) { + ->willReturnCallback(function($str) { return $str; - })); + }); $folder = $this->createMock(ISimpleFolder::class); $this->appData @@ -604,9 +604,9 @@ class ThemingControllerTest extends TestCase { $this->l10n ->expects($this->any()) ->method('t') - ->will($this->returnCallback(function($str) { + ->willReturnCallback(function($str) { return $str; - })); + }); $expected = new DataResponse( [ @@ -643,9 +643,9 @@ class ThemingControllerTest extends TestCase { $this->l10n ->expects($this->any()) ->method('t') - ->will($this->returnCallback(function($str) { + ->willReturnCallback(function($str) { return $str; - })); + }); $expected = new DataResponse( [ -- cgit v1.2.3