diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-06-28 12:26:47 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-06-28 12:26:47 +0200 |
commit | 03498c0b2c7b2c4052293b12402c3dea884fe47e (patch) | |
tree | 1bb53f77254dbfb9aab2786d9d69969dc2e7b5e9 /tests | |
parent | 04fe9e05f0414076cefc99b03faf7896b6f3ec14 (diff) | |
download | nextcloud-server-03498c0b2c7b2c4052293b12402c3dea884fe47e.tar.gz nextcloud-server-03498c0b2c7b2c4052293b12402c3dea884fe47e.zip |
Build base URL
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/updater.php | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/tests/lib/updater.php b/tests/lib/updater.php index 9935d7d11da..8d6a9d65b27 100644 --- a/tests/lib/updater.php +++ b/tests/lib/updater.php @@ -55,6 +55,14 @@ class UpdaterTest extends \Test\TestCase { } /** + * @param string $baseUrl + * @return string + */ + private function buildUpdateUrl($baseUrl) { + return $baseUrl . '?version='.implode('x', \OC_Util::getVersion()).'xinstalledatxlastupdatedatx'.\OC_Util::getChannel().'x'.\OC_Util::getEditionString().'x'; + } + + /** * @return array */ public function versionCompatibilityTestData() { @@ -167,7 +175,7 @@ class UpdaterTest extends \Test\TestCase { $this->httpHelper ->expects($this->once()) ->method('getUrlContent') - ->with('https://updates.owncloud.com/server/?version=8x1x0x7xinstalledatxlastupdatedatxgitxEnterprisex') + ->with($this->buildUpdateUrl('https://updates.owncloud.com/server/')) ->will($this->returnValue($updateXml)); $this->assertSame($expectedResult, $this->updater->check()); @@ -202,7 +210,7 @@ class UpdaterTest extends \Test\TestCase { $this->httpHelper ->expects($this->once()) ->method('getUrlContent') - ->with('https://updates.owncloud.com/server/?version=8x1x0x7xinstalledatxlastupdatedatxgitxEnterprisex') + ->with($this->buildUpdateUrl('https://updates.owncloud.com/server/')) ->will($this->returnValue($updateXml)); $this->assertSame([], $this->updater->check()); @@ -250,7 +258,7 @@ class UpdaterTest extends \Test\TestCase { $this->httpHelper ->expects($this->once()) ->method('getUrlContent') - ->with('https://myupdater.com/?version=8x1x0x7xinstalledatxlastupdatedatxgitxEnterprisex') + ->with($this->buildUpdateUrl('https://myupdater.com/')) ->will($this->returnValue($updateXml)); $this->assertSame($expectedResult, $this->updater->check('https://myupdater.com/')); @@ -294,7 +302,7 @@ class UpdaterTest extends \Test\TestCase { $this->httpHelper ->expects($this->once()) ->method('getUrlContent') - ->with('https://updates.owncloud.com/server/?version=8x1x0x7xinstalledatxlastupdatedatxgitxEnterprisex') + ->with($this->buildUpdateUrl('https://updates.owncloud.com/server/')) ->will($this->returnValue($updateXml)); $this->assertSame($expectedResult, $this->updater->check()); @@ -331,7 +339,7 @@ class UpdaterTest extends \Test\TestCase { $this->httpHelper ->expects($this->once()) ->method('getUrlContent') - ->with('https://updates.owncloud.com/server/?version=8x1x0x7xinstalledatxlastupdatedatxgitxEnterprisex') + ->with($this->buildUpdateUrl('https://updates.owncloud.com/server/')) ->will($this->returnValue($updateXml)); $this->assertSame($expectedResult, $this->updater->check()); |