summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2024-03-04 09:44:19 +0100
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2024-03-04 20:18:32 +0000
commit0b1fcf0a5cdc9bdae254f2365695b96a591f70f7 (patch)
tree401d753aa0eded47f8a05be4817a7b19e80414b2 /tests/lib
parentb6edd4382ec3abe496ac7dedcbe5695a5b6e9c0d (diff)
downloadnextcloud-server-0b1fcf0a5cdc9bdae254f2365695b96a591f70f7.tar.gz
nextcloud-server-0b1fcf0a5cdc9bdae254f2365695b96a591f70f7.zip
fix: Fetch custom app store url without internet connection
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/App/AppStore/Fetcher/CategoryFetcherTest.php5
-rw-r--r--tests/lib/App/AppStore/Fetcher/FetcherBase.php9
2 files changed, 11 insertions, 3 deletions
diff --git a/tests/lib/App/AppStore/Fetcher/CategoryFetcherTest.php b/tests/lib/App/AppStore/Fetcher/CategoryFetcherTest.php
index 874a58fc6ba..dbfca97f999 100644
--- a/tests/lib/App/AppStore/Fetcher/CategoryFetcherTest.php
+++ b/tests/lib/App/AppStore/Fetcher/CategoryFetcherTest.php
@@ -64,6 +64,11 @@ class CategoryFetcherTest extends FetcherBase {
}
return $default;
});
+ $this->config
+ ->method('getSystemValueString')
+ ->willReturnCallback(function ($var, $default) {
+ return $default;
+ });
$this->appData
->expects($this->never())
->method('getFolder');
diff --git a/tests/lib/App/AppStore/Fetcher/FetcherBase.php b/tests/lib/App/AppStore/Fetcher/FetcherBase.php
index dbc3f2a687c..7645cbef599 100644
--- a/tests/lib/App/AppStore/Fetcher/FetcherBase.php
+++ b/tests/lib/App/AppStore/Fetcher/FetcherBase.php
@@ -76,10 +76,13 @@ abstract class FetcherBase extends TestCase {
public function testGetWithAlreadyExistingFileAndUpToDateTimestampAndVersion() {
$this->config
- ->expects($this->exactly(1))
->method('getSystemValueString')
- ->with($this->equalTo('version'), $this->anything())
- ->willReturn('11.0.0.2');
+ ->willReturnCallback(function ($var, $default) {
+ if ($var === 'version') {
+ return '11.0.0.2';
+ }
+ return $default;
+ });
$this->config->method('getSystemValueBool')
->willReturnArgument(1);