diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-06-29 15:07:00 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-06-29 15:07:00 +0200 |
commit | b56af26199aaaf5ca2a2969b0886e6b9b1ae622f (patch) | |
tree | 3aef003fb719aa28ce13d54c561593121e395b51 /tests | |
parent | 70eb20e3a7b65759cdea99279c53953379898d6f (diff) | |
parent | ae3d402dbc3c9620cea5b32bedc7f00874b12dd0 (diff) | |
download | nextcloud-server-b56af26199aaaf5ca2a2969b0886e6b9b1ae622f.tar.gz nextcloud-server-b56af26199aaaf5ca2a2969b0886e6b9b1ae622f.zip |
Merge pull request #17222 from owncloud/issue-17101-send-oc-version-to-app-store
Send OC version to appstore so it can reply with the right links
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/ocsclienttest.php | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/tests/lib/ocsclienttest.php b/tests/lib/ocsclienttest.php index 1e9e551f34e..80102eb62ee 100644 --- a/tests/lib/ocsclienttest.php +++ b/tests/lib/ocsclienttest.php @@ -85,7 +85,7 @@ class OCSClientTest extends \Test\TestCase { ->method('getSystemValue') ->with('appstoreenabled', true) ->will($this->returnValue(false)); - $this->assertNull($this->ocsClient->getCategories()); + $this->assertNull($this->ocsClient->getCategories([8, 1, 0, 7])); } public function testGetCategoriesExceptionClient() { @@ -108,6 +108,7 @@ class OCSClientTest extends \Test\TestCase { 'https://api.owncloud.com/v1/content/categories', [ 'timeout' => 5, + 'query' => ['version' => '8x1x0x7'], ] ) ->will($this->throwException(new \Exception('TheErrorMessage'))); @@ -127,7 +128,7 @@ class OCSClientTest extends \Test\TestCase { ] ); - $this->assertNull($this->ocsClient->getCategories()); + $this->assertNull($this->ocsClient->getCategories([8, 1, 0, 7])); } public function testGetCategoriesParseError() { @@ -156,6 +157,7 @@ class OCSClientTest extends \Test\TestCase { 'https://api.owncloud.com/v1/content/categories', [ 'timeout' => 5, + 'query' => ['version' => '8x1x0x7'], ] ) ->will($this->returnValue($response)); @@ -175,7 +177,7 @@ class OCSClientTest extends \Test\TestCase { ] ); - $this->assertNull($this->ocsClient->getCategories()); + $this->assertNull($this->ocsClient->getCategories([8, 1, 0, 7])); } public function testGetCategoriesSuccessful() { @@ -239,6 +241,7 @@ class OCSClientTest extends \Test\TestCase { 'https://api.owncloud.com/v1/content/categories', [ 'timeout' => 5, + 'query' => ['version' => '8x1x0x7'], ] ) ->will($this->returnValue($response)); @@ -256,7 +259,7 @@ class OCSClientTest extends \Test\TestCase { 924 => 'ownCloud Tool', 925 => 'ownCloud other', ]; - $this->assertSame($expected, $this->ocsClient->getCategories()); + $this->assertSame($expected, $this->ocsClient->getCategories([8, 1, 0, 7])); } public function testGetApplicationsDisabledAppStore() { @@ -265,7 +268,7 @@ class OCSClientTest extends \Test\TestCase { ->method('getSystemValue') ->with('appstoreenabled', true) ->will($this->returnValue(false)); - $this->assertSame([], $this->ocsClient->getApplications([], 1, 'approved')); + $this->assertSame([], $this->ocsClient->getApplications([], 1, 'approved', [8, 1, 0, 7])); } public function testGetApplicationsExceptionClient() { @@ -289,7 +292,7 @@ class OCSClientTest extends \Test\TestCase { [ 'timeout' => 5, 'query' => [ - 'version' => implode('x', \OC_Util::getVersion()), + 'version' => implode('x', [8, 1, 0, 7]), 'filter' => 'approved', 'categories' => '815x1337', 'sortmode' => 'new', @@ -316,7 +319,7 @@ class OCSClientTest extends \Test\TestCase { ] ); - $this->assertSame([], $this->ocsClient->getApplications([815, 1337], 1, 'approved')); + $this->assertSame([], $this->ocsClient->getApplications([815, 1337], 1, 'approved', [8, 1, 0, 7])); } public function testGetApplicationsParseError() { @@ -346,7 +349,7 @@ class OCSClientTest extends \Test\TestCase { [ 'timeout' => 5, 'query' => [ - 'version' => implode('x', \OC_Util::getVersion()), + 'version' => implode('x', [8, 1, 0, 7]), 'filter' => 'approved', 'categories' => '815x1337', 'sortmode' => 'new', @@ -373,7 +376,7 @@ class OCSClientTest extends \Test\TestCase { ] ); - $this->assertSame([], $this->ocsClient->getApplications([815, 1337], 1, 'approved')); + $this->assertSame([], $this->ocsClient->getApplications([815, 1337], 1, 'approved', [8, 1, 0, 7])); } public function testGetApplicationsSuccessful() { @@ -482,7 +485,7 @@ class OCSClientTest extends \Test\TestCase { [ 'timeout' => 5, 'query' => [ - 'version' => implode('x', \OC_Util::getVersion()), + 'version' => implode('x', [8, 1, 0, 7]), 'filter' => 'approved', 'categories' => '815x1337', 'sortmode' => 'new', @@ -539,7 +542,7 @@ class OCSClientTest extends \Test\TestCase { 'profilepage' => 'http://opendesktop.org/usermanager/search.php?username=owncloud', ], ]; - $this->assertEquals($expected, $this->ocsClient->getApplications([815, 1337], 1, 'approved')); + $this->assertEquals($expected, $this->ocsClient->getApplications([815, 1337], 1, 'approved', [8, 1, 0, 7])); } public function tesGetApplicationDisabledAppStore() { @@ -548,7 +551,7 @@ class OCSClientTest extends \Test\TestCase { ->method('getSystemValue') ->with('appstoreenabled', true) ->will($this->returnValue(false)); - $this->assertNull($this->ocsClient->getApplication('MyId')); + $this->assertNull($this->ocsClient->getApplication('MyId', [8, 1, 0, 7])); } public function testGetApplicationExceptionClient() { @@ -571,6 +574,7 @@ class OCSClientTest extends \Test\TestCase { 'https://api.owncloud.com/v1/content/data/MyId', [ 'timeout' => 5, + 'query' => ['version' => '8x1x0x7'], ] ) ->will($this->throwException(new \Exception('TheErrorMessage'))); @@ -590,7 +594,7 @@ class OCSClientTest extends \Test\TestCase { ] ); - $this->assertNull($this->ocsClient->getApplication('MyId')); + $this->assertNull($this->ocsClient->getApplication('MyId', [8, 1, 0, 7])); } public function testGetApplicationParseError() { @@ -619,6 +623,7 @@ class OCSClientTest extends \Test\TestCase { 'https://api.owncloud.com/v1/content/data/MyId', [ 'timeout' => 5, + 'query' => ['version' => '8x1x0x7'], ] ) ->will($this->returnValue($response)); @@ -638,7 +643,7 @@ class OCSClientTest extends \Test\TestCase { ] ); - $this->assertNull($this->ocsClient->getApplication('MyId')); + $this->assertNull($this->ocsClient->getApplication('MyId', [8, 1, 0, 7])); } public function testGetApplicationSuccessful() { @@ -746,6 +751,7 @@ class OCSClientTest extends \Test\TestCase { 'https://api.owncloud.com/v1/content/data/MyId', [ 'timeout' => 5, + 'query' => ['version' => '8x1x0x7'], ] ) ->will($this->returnValue($response)); @@ -773,7 +779,7 @@ class OCSClientTest extends \Test\TestCase { 'score' => 50, 'level' => 200, ]; - $this->assertSame($expected, $this->ocsClient->getApplication('MyId')); + $this->assertSame($expected, $this->ocsClient->getApplication('MyId', [8, 1, 0, 7])); } public function testGetApplicationEmptyXml() { $this->config @@ -809,6 +815,7 @@ class OCSClientTest extends \Test\TestCase { 'https://api.owncloud.com/v1/content/data/MyId', [ 'timeout' => 5, + 'query' => ['version' => '8x1x0x7'], ] ) ->will($this->returnValue($response)); @@ -818,7 +825,7 @@ class OCSClientTest extends \Test\TestCase { ->method('newClient') ->will($this->returnValue($client)); - $this->assertSame(null, $this->ocsClient->getApplication('MyId')); + $this->assertSame(null, $this->ocsClient->getApplication('MyId', [8, 1, 0, 7])); } public function testGetApplicationDownloadDisabledAppStore() { @@ -827,7 +834,7 @@ class OCSClientTest extends \Test\TestCase { ->method('getSystemValue') ->with('appstoreenabled', true) ->will($this->returnValue(false)); - $this->assertNull($this->ocsClient->getApplicationDownload('MyId')); + $this->assertNull($this->ocsClient->getApplicationDownload('MyId', [8, 1, 0, 7])); } public function testGetApplicationDownloadExceptionClient() { @@ -850,6 +857,7 @@ class OCSClientTest extends \Test\TestCase { 'https://api.owncloud.com/v1/content/download/MyId/1', [ 'timeout' => 5, + 'query' => ['version' => '8x1x0x7'], ] ) ->will($this->throwException(new \Exception('TheErrorMessage'))); @@ -869,7 +877,7 @@ class OCSClientTest extends \Test\TestCase { ] ); - $this->assertNull($this->ocsClient->getApplicationDownload('MyId')); + $this->assertNull($this->ocsClient->getApplicationDownload('MyId', [8, 1, 0, 7])); } public function testGetApplicationDownloadParseError() { @@ -898,6 +906,7 @@ class OCSClientTest extends \Test\TestCase { 'https://api.owncloud.com/v1/content/download/MyId/1', [ 'timeout' => 5, + 'query' => ['version' => '8x1x0x7'], ] ) ->will($this->returnValue($response)); @@ -917,7 +926,7 @@ class OCSClientTest extends \Test\TestCase { ] ); - $this->assertNull($this->ocsClient->getApplicationDownload('MyId')); + $this->assertNull($this->ocsClient->getApplicationDownload('MyId', [8, 1, 0, 7])); } public function testGetApplicationDownloadUrlSuccessful() { @@ -964,6 +973,7 @@ class OCSClientTest extends \Test\TestCase { 'https://api.owncloud.com/v1/content/download/MyId/1', [ 'timeout' => 5, + 'query' => ['version' => '8x1x0x7'], ] ) ->will($this->returnValue($response)); @@ -976,6 +986,6 @@ class OCSClientTest extends \Test\TestCase { $expected = [ 'downloadlink' => 'https://apps.owncloud.com/CONTENT/content-files/166052-files_trashbin.zip', ]; - $this->assertSame($expected, $this->ocsClient->getApplicationDownload('MyId')); + $this->assertSame($expected, $this->ocsClient->getApplicationDownload('MyId', [8, 1, 0, 7])); } } |