summaryrefslogtreecommitdiffstats
path: root/tests
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:17:01 +0000
commita258abfe5940fa70edde9932c817b0dbcf72883c (patch)
treede0af8dbe2288b6734d424db162a7e79ef871f80 /tests
parenta14ec0ace63db04966ba6ad596b88ce369c7987b (diff)
downloadnextcloud-server-a258abfe5940fa70edde9932c817b0dbcf72883c.tar.gz
nextcloud-server-a258abfe5940fa70edde9932c817b0dbcf72883c.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);