summaryrefslogtreecommitdiffstats
path: root/tests/lib/Updater
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-03-25 22:21:27 +0100
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-03-25 22:21:27 +0100
commit2ee65f177e4f7e09ad2287f14d564e7068d322fb (patch)
tree39075e87ea7927e20e8956824cb7c49bf626b178 /tests/lib/Updater
parent3cf321fdfc4235a87015a9af2f59c63220016c65 (diff)
downloadnextcloud-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/Updater')
-rw-r--r--tests/lib/Updater/VersionCheckTest.php44
1 files changed, 22 insertions, 22 deletions
diff --git a/tests/lib/Updater/VersionCheckTest.php b/tests/lib/Updater/VersionCheckTest.php
index b25557d5569..2f139319bbf 100644
--- a/tests/lib/Updater/VersionCheckTest.php
+++ b/tests/lib/Updater/VersionCheckTest.php
@@ -74,12 +74,12 @@ class VersionCheckTest extends \Test\TestCase {
->expects($this->at(1))
->method('getAppValue')
->with('core', 'lastupdatedat')
- ->will($this->returnValue(time()));
+ ->willReturn(time());
$this->config
->expects($this->at(2))
->method('getAppValue')
->with('core', 'lastupdateResult')
- ->will($this->returnValue(json_encode($expectedResult)));
+ ->willReturn(json_encode($expectedResult));
$this->assertSame($expectedResult, $this->updater->check());
}
@@ -104,7 +104,7 @@ class VersionCheckTest extends \Test\TestCase {
->expects($this->at(1))
->method('getAppValue')
->with('core', 'lastupdatedat')
- ->will($this->returnValue(0));
+ ->willReturn(0);
$this->config
->expects($this->at(2))
->method('getSystemValue')
@@ -118,12 +118,12 @@ class VersionCheckTest extends \Test\TestCase {
->expects($this->at(5))
->method('getAppValue')
->with('core', 'installedat')
- ->will($this->returnValue('installedat'));
+ ->willReturn('installedat');
$this->config
->expects($this->at(6))
->method('getAppValue')
->with('core', 'lastupdatedat')
- ->will($this->returnValue('lastupdatedat'));
+ ->willReturn('lastupdatedat');
$this->config
->expects($this->at(7))
->method('setAppValue')
@@ -142,7 +142,7 @@ class VersionCheckTest extends \Test\TestCase {
->expects($this->once())
->method('getUrlContent')
->with($this->buildUpdateUrl('https://updates.nextcloud.com/updater_server/'))
- ->will($this->returnValue($updateXml));
+ ->willReturn($updateXml);
$this->assertSame($expectedResult, $this->updater->check());
}
@@ -157,7 +157,7 @@ class VersionCheckTest extends \Test\TestCase {
->expects($this->at(1))
->method('getAppValue')
->with('core', 'lastupdatedat')
- ->will($this->returnValue(0));
+ ->willReturn(0);
$this->config
->expects($this->at(2))
->method('getSystemValue')
@@ -171,12 +171,12 @@ class VersionCheckTest extends \Test\TestCase {
->expects($this->at(5))
->method('getAppValue')
->with('core', 'installedat')
- ->will($this->returnValue('installedat'));
+ ->willReturn('installedat');
$this->config
->expects($this->at(6))
->method('getAppValue')
->with('core', 'lastupdatedat')
- ->will($this->returnValue('lastupdatedat'));
+ ->willReturn('lastupdatedat');
$this->config
->expects($this->at(7))
->method('setAppValue')
@@ -187,7 +187,7 @@ class VersionCheckTest extends \Test\TestCase {
->expects($this->once())
->method('getUrlContent')
->with($this->buildUpdateUrl('https://updates.nextcloud.com/updater_server/'))
- ->will($this->returnValue($updateXml));
+ ->willReturn($updateXml);
$this->assertSame([], $this->updater->check());
}
@@ -212,7 +212,7 @@ class VersionCheckTest extends \Test\TestCase {
->expects($this->at(1))
->method('getAppValue')
->with('core', 'lastupdatedat')
- ->will($this->returnValue(0));
+ ->willReturn(0);
$this->config
->expects($this->at(2))
->method('getSystemValue')
@@ -226,12 +226,12 @@ class VersionCheckTest extends \Test\TestCase {
->expects($this->at(5))
->method('getAppValue')
->with('core', 'installedat')
- ->will($this->returnValue('installedat'));
+ ->willReturn('installedat');
$this->config
->expects($this->at(6))
->method('getAppValue')
->with('core', 'lastupdatedat')
- ->will($this->returnValue('lastupdatedat'));
+ ->willReturn('lastupdatedat');
$updateXml = '<?xml version="1.0"?>
<owncloud>
@@ -245,7 +245,7 @@ class VersionCheckTest extends \Test\TestCase {
->expects($this->once())
->method('getUrlContent')
->with($this->buildUpdateUrl('https://updates.nextcloud.com/updater_server/'))
- ->will($this->returnValue($updateXml));
+ ->willReturn($updateXml);
$this->assertSame($expectedResult, $this->updater->check());
}
@@ -262,7 +262,7 @@ class VersionCheckTest extends \Test\TestCase {
->expects($this->at(1))
->method('getAppValue')
->with('core', 'lastupdatedat')
- ->will($this->returnValue(0));
+ ->willReturn(0);
$this->config
->expects($this->at(2))
->method('getSystemValue')
@@ -276,12 +276,12 @@ class VersionCheckTest extends \Test\TestCase {
->expects($this->at(5))
->method('getAppValue')
->with('core', 'installedat')
- ->will($this->returnValue('installedat'));
+ ->willReturn('installedat');
$this->config
->expects($this->at(6))
->method('getAppValue')
->with('core', 'lastupdatedat')
- ->will($this->returnValue('lastupdatedat'));
+ ->willReturn('lastupdatedat');
$this->config
->expects($this->at(7))
->method('setAppValue')
@@ -292,7 +292,7 @@ class VersionCheckTest extends \Test\TestCase {
->expects($this->once())
->method('getUrlContent')
->with($this->buildUpdateUrl('https://updates.nextcloud.com/updater_server/'))
- ->will($this->returnValue($updateXml));
+ ->willReturn($updateXml);
$this->assertSame($expectedResult, $this->updater->check());
}
@@ -317,7 +317,7 @@ class VersionCheckTest extends \Test\TestCase {
->expects($this->at(1))
->method('getAppValue')
->with('core', 'lastupdatedat')
- ->will($this->returnValue(0));
+ ->willReturn(0);
$this->config
->expects($this->at(2))
->method('getSystemValue')
@@ -331,12 +331,12 @@ class VersionCheckTest extends \Test\TestCase {
->expects($this->at(5))
->method('getAppValue')
->with('core', 'installedat')
- ->will($this->returnValue('installedat'));
+ ->willReturn('installedat');
$this->config
->expects($this->at(6))
->method('getAppValue')
->with('core', 'lastupdatedat')
- ->will($this->returnValue('lastupdatedat'));
+ ->willReturn('lastupdatedat');
// missing autoupdater element should still not fail
$updateXml = '<?xml version="1.0"?>
@@ -350,7 +350,7 @@ class VersionCheckTest extends \Test\TestCase {
->expects($this->once())
->method('getUrlContent')
->with($this->buildUpdateUrl('https://updates.nextcloud.com/updater_server/'))
- ->will($this->returnValue($updateXml));
+ ->willReturn($updateXml);
$this->assertSame($expectedResult, $this->updater->check());
}