diff options
author | Julius Härtl <jus@bitgrid.net> | 2024-03-04 09:44:19 +0100 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2024-03-04 20:17:01 +0000 |
commit | a258abfe5940fa70edde9932c817b0dbcf72883c (patch) | |
tree | de0af8dbe2288b6734d424db162a7e79ef871f80 /tests | |
parent | a14ec0ace63db04966ba6ad596b88ce369c7987b (diff) | |
download | nextcloud-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.php | 5 | ||||
-rw-r--r-- | tests/lib/App/AppStore/Fetcher/FetcherBase.php | 9 |
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); |