aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Updater
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2024-09-15 22:32:31 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2024-09-15 22:32:31 +0200
commit49dd79eabb2b8902559a7a4e8f8fcad54f46b604 (patch)
tree2af18db46ba463368dc4461d7436fb69577923de /tests/lib/Updater
parent4281ce6fa1bb8235426099d720734d2394bec203 (diff)
downloadnextcloud-server-49dd79eabb2b8902559a7a4e8f8fcad54f46b604.tar.gz
nextcloud-server-49dd79eabb2b8902559a7a4e8f8fcad54f46b604.zip
refactor: Add void return type to PHPUnit test methods
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'tests/lib/Updater')
-rw-r--r--tests/lib/Updater/ChangesCheckTest.php16
-rw-r--r--tests/lib/Updater/ReleaseMetadataTest.php4
-rw-r--r--tests/lib/Updater/VersionCheckTest.php14
3 files changed, 17 insertions, 17 deletions
diff --git a/tests/lib/Updater/ChangesCheckTest.php b/tests/lib/Updater/ChangesCheckTest.php
index 26da6579d33..81eaa95d1fe 100644
--- a/tests/lib/Updater/ChangesCheckTest.php
+++ b/tests/lib/Updater/ChangesCheckTest.php
@@ -54,7 +54,7 @@ class ChangesCheckTest extends TestCase {
/**
* @dataProvider statusCodeProvider
*/
- public function testEvaluateResponse(int $statusCode, int $expected) {
+ public function testEvaluateResponse(int $statusCode, int $expected): void {
$response = $this->createMock(IResponse::class);
$response->expects($this->atLeastOnce())
->method('getStatusCode')
@@ -69,7 +69,7 @@ class ChangesCheckTest extends TestCase {
$this->assertSame($expected, $evaluation);
}
- public function testCacheResultInsert() {
+ public function testCacheResultInsert(): void {
$version = '13.0.4';
$entry = $this->createMock(Changes::class);
$entry->expects($this->exactly(2))
@@ -85,7 +85,7 @@ class ChangesCheckTest extends TestCase {
$this->invokePrivate($this->checker, 'cacheResult', [$entry, $version]);
}
- public function testCacheResultUpdate() {
+ public function testCacheResultUpdate(): void {
$version = '13.0.4';
$entry = $this->createMock(Changes::class);
$entry->expects($this->once())
@@ -272,7 +272,7 @@ class ChangesCheckTest extends TestCase {
/**
* @dataProvider changesXMLProvider
*/
- public function testExtractData(string $body, array $expected) {
+ public function testExtractData(string $body, array $expected): void {
$actual = $this->invokePrivate($this->checker, 'extractData', [$body]);
$this->assertSame($expected, $actual);
}
@@ -287,7 +287,7 @@ class ChangesCheckTest extends TestCase {
/**
* @dataProvider etagProvider
*/
- public function testQueryChangesServer(string $etag) {
+ public function testQueryChangesServer(string $etag): void {
$uri = 'https://changes.nextcloud.server/?13.0.5';
$entry = $this->createMock(Changes::class);
$entry->expects($this->any())
@@ -324,7 +324,7 @@ class ChangesCheckTest extends TestCase {
/**
* @dataProvider versionProvider
*/
- public function testNormalizeVersion(string $input, string $expected) {
+ public function testNormalizeVersion(string $input, string $expected): void {
$normalized = $this->checker->normalizeVersion($input);
$this->assertSame($expected, $normalized);
}
@@ -344,7 +344,7 @@ class ChangesCheckTest extends TestCase {
* @dataProvider changeDataProvider
*
*/
- public function testGetChangesForVersion(string $inputVersion, string $normalizedVersion, bool $isFound) {
+ public function testGetChangesForVersion(string $inputVersion, string $normalizedVersion, bool $isFound): void {
$mocker = $this->mapper->expects($this->once())
->method('getChanges')
->with($normalizedVersion);
@@ -368,7 +368,7 @@ class ChangesCheckTest extends TestCase {
$this->assertTrue(isset($data['changelogURL']));
}
- public function testGetChangesForVersionEmptyData() {
+ public function testGetChangesForVersionEmptyData(): void {
$entry = $this->createMock(Changes::class);
$entry->expects($this->once())
->method('__call')
diff --git a/tests/lib/Updater/ReleaseMetadataTest.php b/tests/lib/Updater/ReleaseMetadataTest.php
index 5191d1f6c3c..72c6da5064d 100644
--- a/tests/lib/Updater/ReleaseMetadataTest.php
+++ b/tests/lib/Updater/ReleaseMetadataTest.php
@@ -22,7 +22,7 @@ class ReleaseMetadataTest extends \Test\TestCase {
->getMock();
}
- public function testDownloadMetadata() {
+ public function testDownloadMetadata(): void {
$client = $this->createMock(IClient::class);
$response = $this->createMock(IResponse::class);
$this->clientService->expects($this->once())
@@ -48,7 +48,7 @@ class ReleaseMetadataTest extends \Test\TestCase {
* @param string $version
* @param string $url
*/
- public function testGetMetadata(string $version, string $url) {
+ public function testGetMetadata(string $version, string $url): void {
$client = $this->createMock(IClient::class);
$response = $this->createMock(IResponse::class);
$this->clientService->expects($this->once())
diff --git a/tests/lib/Updater/VersionCheckTest.php b/tests/lib/Updater/VersionCheckTest.php
index b8a32680fb0..b33829a2155 100644
--- a/tests/lib/Updater/VersionCheckTest.php
+++ b/tests/lib/Updater/VersionCheckTest.php
@@ -66,7 +66,7 @@ class VersionCheckTest extends \Test\TestCase {
return $baseUrl . '?version='.implode('x', Util::getVersion()).'xinstalledatx' . time() . 'x'.\OC_Util::getChannel().'xxx'.PHP_MAJOR_VERSION.'x'.PHP_MINOR_VERSION.'x'.PHP_RELEASE_VERSION.'x0x0';
}
- public function testCheckInCache() {
+ public function testCheckInCache(): void {
$expectedResult = [
'version' => '8.0.4.2',
'versionstring' => 'ownCloud 8.0.4',
@@ -94,7 +94,7 @@ class VersionCheckTest extends \Test\TestCase {
$this->assertSame($expectedResult, $this->updater->check());
}
- public function testCheckWithoutUpdateUrl() {
+ public function testCheckWithoutUpdateUrl(): void {
$expectedResult = [
'version' => '8.0.4.2',
'versionstring' => 'ownCloud 8.0.4',
@@ -155,7 +155,7 @@ class VersionCheckTest extends \Test\TestCase {
$this->assertSame($expectedResult, $this->updater->check());
}
- public function testCheckWithInvalidXml() {
+ public function testCheckWithInvalidXml(): void {
$this->config
->expects($this->once())
->method('getSystemValueBool')
@@ -198,7 +198,7 @@ class VersionCheckTest extends \Test\TestCase {
$this->assertSame([], $this->updater->check());
}
- public function testCheckWithEmptyValidXmlResponse() {
+ public function testCheckWithEmptyValidXmlResponse(): void {
$expectedResult = [
'version' => '',
'versionstring' => '',
@@ -258,7 +258,7 @@ class VersionCheckTest extends \Test\TestCase {
$this->assertSame($expectedResult, $this->updater->check());
}
- public function testCheckWithEmptyInvalidXmlResponse() {
+ public function testCheckWithEmptyInvalidXmlResponse(): void {
$expectedResult = [];
$this->config
@@ -303,7 +303,7 @@ class VersionCheckTest extends \Test\TestCase {
$this->assertSame($expectedResult, $this->updater->check());
}
- public function testCheckWithMissingAttributeXmlResponse() {
+ public function testCheckWithMissingAttributeXmlResponse(): void {
$expectedResult = [
'version' => '',
'versionstring' => '',
@@ -363,7 +363,7 @@ class VersionCheckTest extends \Test\TestCase {
$this->assertSame($expectedResult, $this->updater->check());
}
- public function testNoInternet() {
+ public function testNoInternet(): void {
$this->config
->expects($this->once())
->method('getSystemValueBool')