aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2024-03-04 09:44:19 +0100
committerJulius Härtl <jus@bitgrid.net>2024-03-04 12:47:14 +0100
commite13fb468cf45d6713c26109f1121ed5e2a0bbb99 (patch)
treef8145cf001287204acc8b753577825ea5ab4fcb8 /tests
parent1d100bdcd989b1343d644f554a8990318abeed80 (diff)
downloadnextcloud-server-e13fb468cf45d6713c26109f1121ed5e2a0bbb99.tar.gz
nextcloud-server-e13fb468cf45d6713c26109f1121ed5e2a0bbb99.zip
fix: Fetch custom app store url without internet connection
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'tests')
-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);