Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Apr 23, 2024
1 parent 841803d commit 53952a8
Showing 1 changed file with 31 additions and 6 deletions.
37 changes: 31 additions & 6 deletions tests/unit/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public function updateDataProvider(): array
'1.9.0',
'stable',
false,
false,
$configThrottle,
'<?xml version="1.0"?>
<owncloudclient><version>2.2.2.6192</version><versionstring>Nextcloud Client 2.2.2 (build 6192)</versionstring><downloadurl>https://download.nextcloud.com/desktop/stable/ownCloud-2.2.2.6192-setup.exe</downloadurl></owncloudclient>
Expand All @@ -100,6 +101,7 @@ public function updateDataProvider(): array
'1.9.0',
'stable',
false,
false,
$config,
'<?xml version="1.0"?>
<owncloudclient><version>2.2.2.6192</version><versionstring>Nextcloud Client 2.2.2 (build 6192)</versionstring><downloadurl>https://download.nextcloud.com/desktop/stable/ownCloud-2.2.2.6192-setup.exe</downloadurl></owncloudclient>
Expand All @@ -112,6 +114,7 @@ public function updateDataProvider(): array
'1.9.0',
'stable',
true,
false,
$config,
'<?xml version="1.0"?>
<owncloudclient><version>2.2.2.6192</version><versionstring>Nextcloud Client 2.2.2 (build 6192)</versionstring><downloadurl>https://download.nextcloud.com/desktop/stable/ownCloud-2.2.2.6192-setup.exe</downloadurl></owncloudclient>
Expand All @@ -124,6 +127,7 @@ public function updateDataProvider(): array
'1.9.0',
'stable',
false,
false,
$config,
'<?xml version="1.0"?>
<owncloudclient><version>2.2.2</version><versionstring>Nextcloud Client 2.2.2</versionstring><downloadurl>https://download.nextcloud.com/desktop/stable/Nextcloud-2.2.2-x64.AppImage</downloadurl><web>https://nextcloud.com/install/#install-clients</web></owncloudclient>
Expand All @@ -136,6 +140,7 @@ public function updateDataProvider(): array
'1.9.0',
'stable',
false,
false,
$config,
'<?xml version="1.0"?>
<owncloudclient><version>2.2.2.3472</version><versionstring>Nextcloud Client 2.2.2 (build 3472)</versionstring><downloadurl>https://download.owncloud.com/desktop/stable/ownCloud-2.2.2.3472.pkg</downloadurl><sparkleDownloadUrl>https://download.owncloud.com/desktop/stable/ownCloud-2.2.2.3472.pkg.tbz</sparkleDownloadUrl><signature>MC0CFQDmXR6biDmNVW7TvMh0bfPPTzCvtwIUCzASgpzYdi4lltOnwbFCeQwgDjY=</signature><length>62738920</length></owncloudclient>
Expand All @@ -148,6 +153,7 @@ public function updateDataProvider(): array
'1.9.0',
'stable',
true,
false,
$config,
'<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/">
Expand All @@ -158,7 +164,7 @@ public function updateDataProvider(): array
<title>Nextcloud Client 2.2.2 (build 3472)</title>
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
<enclosure url="https://download.owncloud.com/desktop/stable/ownCloud-2.2.2.3472.pkg.tbz" sparkle:version="2.2.2.3472" type="application/octet-stream" sparkle:edSignature="MC0CFQDmXR6biDmNVW7TvMh0bfPPTzCvtwIUCzASgpzYdi4lltOnwbFCeQwgDjY=" length="62738920"/>
<sparkle:minimumSystemVersion>10.13.0</sparkle:minimumSystemVersion>
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
</item></channel>
</rss>'
],
Expand All @@ -169,6 +175,7 @@ public function updateDataProvider(): array
'1.9.0',
'beta',
false,
false,
$config,
'<?xml version="1.0"?>
<owncloudclient><version>2.2.3-rc3</version><versionstring>Nextcloud Client 2.2.3-rc3</versionstring><downloadurl>https://download.nextcloud.com/desktop/stable/Nextcloud-2.2.3-rc3-x86.msi</downloadurl><web>https://nextcloud.com/install/#install-clients</web></owncloudclient>
Expand All @@ -181,6 +188,7 @@ public function updateDataProvider(): array
'2.2.3-rc1',
'beta',
false,
false,
$config,
'<?xml version="1.0"?>
<owncloudclient><version>2.2.3-rc3</version><versionstring>Nextcloud Client 2.2.3-rc3</versionstring><downloadurl>https://download.nextcloud.com/desktop/stable/Nextcloud-2.2.3-rc3-x86.msi</downloadurl><web>https://nextcloud.com/install/#install-clients</web></owncloudclient>
Expand All @@ -193,6 +201,7 @@ public function updateDataProvider(): array
'2.2.2-rc1',
'beta',
false,
false,
$config,
'<?xml version="1.0"?>
<owncloudclient><version>2.2.2</version><versionstring>Nextcloud Client 2.2.2</versionstring><downloadurl>https://download.nextcloud.com/desktop/stable/Nextcloud-2.2.2-x64.AppImage</downloadurl><web>https://nextcloud.com/install/#install-clients</web></owncloudclient>
Expand All @@ -205,6 +214,7 @@ public function updateDataProvider(): array
'1.9.0',
'stable',
false,
false,
$config,
'<?xml version="1.0"?>
<owncloudclient/>
Expand All @@ -217,6 +227,7 @@ public function updateDataProvider(): array
'1.9.0',
'stable',
false,
false,
$config,
'<?xml version="1.0"?>
<owncloudclient/>
Expand All @@ -229,6 +240,7 @@ public function updateDataProvider(): array
'2.2.2.6192',
'stable',
false,
false,
$config,
'<?xml version="1.0"?>
<owncloudclient/>
Expand All @@ -241,6 +253,7 @@ public function updateDataProvider(): array
'2.2.6192',
'stable',
true,
false,
$config,
'<?xml version="1.0"?>
<owncloudclient/>
Expand All @@ -253,6 +266,7 @@ public function updateDataProvider(): array
'2.2.2',
'stable',
false,
false,
$config,
'<?xml version="1.0"?>
<owncloudclient/>
Expand All @@ -265,6 +279,7 @@ public function updateDataProvider(): array
'2.2.2.3472',
'stable',
false,
false,
$config,
'<?xml version="1.0"?>
<owncloudclient/>
Expand All @@ -277,6 +292,7 @@ public function updateDataProvider(): array
'2.2.2.3472',
'stable',
true,
false,
$config,
'<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/">
Expand All @@ -287,7 +303,7 @@ public function updateDataProvider(): array
<title>Nextcloud Client 2.2.2 (build 3472)</title>
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
<enclosure url="https://download.owncloud.com/desktop/stable/ownCloud-2.2.2.3472.pkg.tbz" sparkle:version="2.2.2.3472" type="application/octet-stream" sparkle:edSignature="MC0CFQDmXR6biDmNVW7TvMh0bfPPTzCvtwIUCzASgpzYdi4lltOnwbFCeQwgDjY=" length="62738920"/>
<sparkle:minimumSystemVersion>10.13.0</sparkle:minimumSystemVersion>
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
</item></channel>
</rss>'
],
Expand All @@ -298,6 +314,7 @@ public function updateDataProvider(): array
'2.3',
'stable',
false,
false,
$config,
'<?xml version="1.0"?>
<owncloudclient/>
Expand All @@ -310,6 +327,7 @@ public function updateDataProvider(): array
'2.3',
'stable',
true,
false,
$config,
'<?xml version="1.0"?>
<owncloudclient/>
Expand All @@ -322,6 +340,7 @@ public function updateDataProvider(): array
'2.3',
'stable',
false,
false,
$config,
'<?xml version="1.0"?>
<owncloudclient/>
Expand All @@ -334,6 +353,7 @@ public function updateDataProvider(): array
'2.3',
'stable',
false,
false,
$config,
'<?xml version="1.0"?>
<owncloudclient/>
Expand All @@ -346,6 +366,7 @@ public function updateDataProvider(): array
'2.3',
'stable',
true,
false,
$config,
'<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/">
Expand All @@ -356,7 +377,7 @@ public function updateDataProvider(): array
<title>Nextcloud Client 2.2.2 (build 3472)</title>
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
<enclosure url="https://download.owncloud.com/desktop/stable/ownCloud-2.2.2.3472.pkg.tbz" sparkle:version="2.2.2.3472" type="application/octet-stream" sparkle:edSignature="MC0CFQDmXR6biDmNVW7TvMh0bfPPTzCvtwIUCzASgpzYdi4lltOnwbFCeQwgDjY=" length="62738920"/>
<sparkle:minimumSystemVersion>10.13.0</sparkle:minimumSystemVersion>
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
</item></channel>
</rss>'
],
Expand All @@ -367,6 +388,7 @@ public function updateDataProvider(): array
'2.2.2-rc2',
'beta',
true,
false,
$config,
'<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/">
Expand All @@ -377,7 +399,7 @@ public function updateDataProvider(): array
<title>Nextcloud Client 2.2.2-rc2</title>
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
<enclosure url="https://download.nextcloud.com/desktop/stable/Nextcloud-2.2.2-rc1.pkg.tbz" sparkle:version="2.2.2-rc2" type="application/octet-stream" sparkle:edSignature="MC0CFQDmXR6biDmNVW7TvMh0bfPPTzCvtwIUCzASgpzYdi4lltOnwbFCeQwgDjY=" length="62738920"/>
<sparkle:minimumSystemVersion>10.13.0</sparkle:minimumSystemVersion>
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
</item></channel>
</rss>'
],
Expand All @@ -388,6 +410,7 @@ public function updateDataProvider(): array
'2.2.2',
'beta',
true,
false,
$config,
'<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/">
Expand All @@ -398,7 +421,7 @@ public function updateDataProvider(): array
<title>Nextcloud Client 2.2.2-rc2</title>
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
<enclosure url="https://download.nextcloud.com/desktop/stable/Nextcloud-2.2.2-rc1.pkg.tbz" sparkle:version="2.2.2-rc2" type="application/octet-stream" sparkle:edSignature="MC0CFQDmXR6biDmNVW7TvMh0bfPPTzCvtwIUCzASgpzYdi4lltOnwbFCeQwgDjY=" length="62738920"/>
<sparkle:minimumSystemVersion>10.13.0</sparkle:minimumSystemVersion>
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
</item></channel>
</rss>'
]
Expand All @@ -413,6 +436,7 @@ public function updateDataProvider(): array
* @param string $version
* @param string $channel
* @param bool $isSparkle
* @param bool $isFileProvider
* @param array $config
* @param string $expected
*/
Expand All @@ -421,10 +445,11 @@ public function testBuildResponse(string $oem,
string $version,
string $channel,
bool $isSparkle,
bool $isFileProvider,
array $config,
string $expected) {
$response = $this->getMockBuilder('\ClientUpdateServer\Response')
->setConstructorArgs([$oem, $platform, $version, $channel, $isSparkle, $config])
->setConstructorArgs([$oem, $platform, $version, $channel, $isSparkle, $isFileProvider, $config])
->setMethods(['getCurrentTimeStamp'])
->getMock();
$response
Expand Down

0 comments on commit 53952a8

Please sign in to comment.