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/CalDAV/Schedule/IMipPluginTest.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/CalDAV/Schedule/IMipPluginTest.php')
-rw-r--r-- | apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php b/apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php index b1da96f4c03..0d48392686a 100644 --- a/apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php +++ b/apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php @@ -78,9 +78,9 @@ class IMipPluginTest extends TestCase { $l10n = $this->createMock(IL10N::class); $l10n->method('t') - ->will($this->returnCallback(function($text, $parameters = []) { + ->willReturnCallback(function($text, $parameters = []) { return vsprintf($text, $parameters); - })); + }); $l10nFactory = $this->createMock(IFactory::class); $l10nFactory->method('get')->willReturn($l10n); @@ -90,16 +90,16 @@ class IMipPluginTest extends TestCase { $db = $this->createMock(IDBConnection::class); $db->method('getQueryBuilder') ->with() - ->will($this->returnValue($this->queryBuilder)); + ->willReturn($this->queryBuilder); $random = $this->createMock(ISecureRandom::class); $random->method('generate') ->with(60, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') - ->will($this->returnValue('random_token')); + ->willReturn('random_token'); $defaults = $this->createMock(Defaults::class); $defaults->method('getName') - ->will($this->returnValue('Instance Name 123')); + ->willReturn('Instance Name 123'); $this->plugin = new IMipPlugin($this->config, $this->mailer, $logger, $this->timeFactory, $l10nFactory, $urlGenerator, $defaults, $random, $db, $this->userManager, 'user123'); } @@ -269,10 +269,10 @@ class IMipPluginTest extends TestCase { $this->queryBuilder->expects($this->at(0)) ->method('insert') ->with('calendar_invitations') - ->will($this->returnValue($this->queryBuilder)); + ->willReturn($this->queryBuilder); $this->queryBuilder->expects($this->at(8)) ->method('values') - ->will($this->returnValue($this->queryBuilder)); + ->willReturn($this->queryBuilder); $this->queryBuilder->expects($this->at(9)) ->method('execute'); } |