|
|
|
@ -77,7 +77,7 @@ abstract class FetcherBase extends TestCase { |
|
|
|
|
public function testGetWithAlreadyExistingFileAndUpToDateTimestampAndVersion() { |
|
|
|
|
$this->config |
|
|
|
|
->expects($this->at(0)) |
|
|
|
|
->method('getSystemValue') |
|
|
|
|
->method('getSystemValueBool') |
|
|
|
|
->with('appstoreenabled', true) |
|
|
|
|
->willReturn(true); |
|
|
|
|
$this->config |
|
|
|
@ -126,9 +126,7 @@ abstract class FetcherBase extends TestCase { |
|
|
|
|
$this->config |
|
|
|
|
->method('getSystemValue') |
|
|
|
|
->willReturnCallback(function ($var, $default) { |
|
|
|
|
if ($var === 'appstoreenabled') { |
|
|
|
|
return true; |
|
|
|
|
} elseif ($var === 'has_internet_connection') { |
|
|
|
|
if ($var === 'has_internet_connection') { |
|
|
|
|
return true; |
|
|
|
|
} elseif ($var === 'appstoreurl') { |
|
|
|
|
return 'https://apps.nextcloud.com/api/v1'; |
|
|
|
@ -137,6 +135,10 @@ abstract class FetcherBase extends TestCase { |
|
|
|
|
} |
|
|
|
|
return $default; |
|
|
|
|
}); |
|
|
|
|
$this->config |
|
|
|
|
->method('getSystemValueBool') |
|
|
|
|
->with('appstoreenabled', $this->anything()) |
|
|
|
|
->willReturn(true); |
|
|
|
|
|
|
|
|
|
$folder = $this->createMock(ISimpleFolder::class); |
|
|
|
|
$file = $this->createMock(ISimpleFile::class); |
|
|
|
@ -202,14 +204,16 @@ abstract class FetcherBase extends TestCase { |
|
|
|
|
public function testGetWithAlreadyExistingFileAndOutdatedTimestamp() { |
|
|
|
|
$this->config->method('getSystemValue') |
|
|
|
|
->willReturnCallback(function ($key, $default) { |
|
|
|
|
if ($key === 'appstoreenabled') { |
|
|
|
|
return true; |
|
|
|
|
} elseif ($key === 'version') { |
|
|
|
|
if ($key === 'version') { |
|
|
|
|
return '11.0.0.2'; |
|
|
|
|
} else { |
|
|
|
|
return $default; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
$this->config |
|
|
|
|
->method('getSystemValueBool') |
|
|
|
|
->with('appstoreenabled', true) |
|
|
|
|
->willReturn(true); |
|
|
|
|
|
|
|
|
|
$folder = $this->createMock(ISimpleFolder::class); |
|
|
|
|
$file = $this->createMock(ISimpleFile::class); |
|
|
|
@ -279,9 +283,7 @@ abstract class FetcherBase extends TestCase { |
|
|
|
|
$this->config |
|
|
|
|
->method('getSystemValue') |
|
|
|
|
->willReturnCallback(function ($var, $default) { |
|
|
|
|
if ($var === 'appstoreenabled') { |
|
|
|
|
return true; |
|
|
|
|
} elseif ($var === 'has_internet_connection') { |
|
|
|
|
if ($var === 'has_internet_connection') { |
|
|
|
|
return true; |
|
|
|
|
} elseif ($var === 'appstoreurl') { |
|
|
|
|
return 'https://apps.nextcloud.com/api/v1'; |
|
|
|
@ -290,6 +292,10 @@ abstract class FetcherBase extends TestCase { |
|
|
|
|
} |
|
|
|
|
return $default; |
|
|
|
|
}); |
|
|
|
|
$this->config |
|
|
|
|
->method('getSystemValueBool') |
|
|
|
|
->with('appstoreenabled', true) |
|
|
|
|
->willReturn(true); |
|
|
|
|
|
|
|
|
|
$folder = $this->createMock(ISimpleFolder::class); |
|
|
|
|
$file = $this->createMock(ISimpleFile::class); |
|
|
|
@ -355,9 +361,7 @@ abstract class FetcherBase extends TestCase { |
|
|
|
|
$this->config |
|
|
|
|
->method('getSystemValue') |
|
|
|
|
->willReturnCallback(function ($var, $default) { |
|
|
|
|
if ($var === 'appstoreenabled') { |
|
|
|
|
return true; |
|
|
|
|
} elseif ($var === 'has_internet_connection') { |
|
|
|
|
if ($var === 'has_internet_connection') { |
|
|
|
|
return true; |
|
|
|
|
} elseif ($var === 'appstoreurl') { |
|
|
|
|
return 'https://apps.nextcloud.com/api/v1'; |
|
|
|
@ -366,6 +370,10 @@ abstract class FetcherBase extends TestCase { |
|
|
|
|
} |
|
|
|
|
return $default; |
|
|
|
|
}); |
|
|
|
|
$this->config |
|
|
|
|
->method('getSystemValueBool') |
|
|
|
|
->with('appstoreenabled', true) |
|
|
|
|
->willReturn(true); |
|
|
|
|
|
|
|
|
|
$folder = $this->createMock(ISimpleFolder::class); |
|
|
|
|
$file = $this->createMock(ISimpleFile::class); |
|
|
|
@ -429,12 +437,12 @@ abstract class FetcherBase extends TestCase { |
|
|
|
|
public function testGetWithExceptionInClient() { |
|
|
|
|
$this->config->method('getSystemValue') |
|
|
|
|
->willReturnCallback(function ($key, $default) { |
|
|
|
|
if ($key === 'appstoreenabled') { |
|
|
|
|
return true; |
|
|
|
|
} else { |
|
|
|
|
return $default; |
|
|
|
|
} |
|
|
|
|
return $default; |
|
|
|
|
}); |
|
|
|
|
$this->config |
|
|
|
|
->method('getSystemValueBool') |
|
|
|
|
->with('appstoreenabled', true) |
|
|
|
|
->willReturn(true); |
|
|
|
|
|
|
|
|
|
$folder = $this->createMock(ISimpleFolder::class); |
|
|
|
|
$file = $this->createMock(ISimpleFile::class); |
|
|
|
@ -469,14 +477,16 @@ abstract class FetcherBase extends TestCase { |
|
|
|
|
public function testGetMatchingETag() { |
|
|
|
|
$this->config->method('getSystemValue') |
|
|
|
|
->willReturnCallback(function ($key, $default) { |
|
|
|
|
if ($key === 'appstoreenabled') { |
|
|
|
|
return true; |
|
|
|
|
} elseif ($key === 'version') { |
|
|
|
|
if ($key === 'version') { |
|
|
|
|
return '11.0.0.2'; |
|
|
|
|
} else { |
|
|
|
|
return $default; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
$this->config |
|
|
|
|
->method('getSystemValueBool') |
|
|
|
|
->with('appstoreenabled', true) |
|
|
|
|
->willReturn(true); |
|
|
|
|
|
|
|
|
|
$folder = $this->createMock(ISimpleFolder::class); |
|
|
|
|
$file = $this->createMock(ISimpleFile::class); |
|
|
|
@ -550,14 +560,16 @@ abstract class FetcherBase extends TestCase { |
|
|
|
|
public function testGetNoMatchingETag() { |
|
|
|
|
$this->config->method('getSystemValue') |
|
|
|
|
->willReturnCallback(function ($key, $default) { |
|
|
|
|
if ($key === 'appstoreenabled') { |
|
|
|
|
return true; |
|
|
|
|
} elseif ($key === 'version') { |
|
|
|
|
if ($key === 'version') { |
|
|
|
|
return '11.0.0.2'; |
|
|
|
|
} else { |
|
|
|
|
return $default; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
$this->config |
|
|
|
|
->method('getSystemValueBool') |
|
|
|
|
->with('appstoreenabled', true) |
|
|
|
|
->willReturn(true); |
|
|
|
|
|
|
|
|
|
$folder = $this->createMock(ISimpleFolder::class); |
|
|
|
|
$file = $this->createMock(ISimpleFile::class); |
|
|
|
@ -637,14 +649,16 @@ abstract class FetcherBase extends TestCase { |
|
|
|
|
public function testFetchAfterUpgradeNoETag() { |
|
|
|
|
$this->config->method('getSystemValue') |
|
|
|
|
->willReturnCallback(function ($key, $default) { |
|
|
|
|
if ($key === 'appstoreenabled') { |
|
|
|
|
return true; |
|
|
|
|
} elseif ($key === 'version') { |
|
|
|
|
if ($key === 'version') { |
|
|
|
|
return '11.0.0.3'; |
|
|
|
|
} else { |
|
|
|
|
return $default; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
$this->config |
|
|
|
|
->method('getSystemValueBool') |
|
|
|
|
->with('appstoreenabled', true) |
|
|
|
|
->willReturn(true); |
|
|
|
|
|
|
|
|
|
$folder = $this->createMock(ISimpleFolder::class); |
|
|
|
|
$file = $this->createMock(ISimpleFile::class); |
|
|
|
|