|
|
|
@ -28,7 +28,7 @@ namespace Test\Updater;
|
|
|
|
|
|
|
|
|
|
use OC\Updater\ChangesCheck;
|
|
|
|
|
use OC\Updater\ChangesMapper;
|
|
|
|
|
use OC\Updater\ChangesResult;
|
|
|
|
|
use OC\Updater\Changes;
|
|
|
|
|
use OCP\AppFramework\Db\DoesNotExistException;
|
|
|
|
|
use OCP\Http\Client\IClient;
|
|
|
|
|
use OCP\Http\Client\IClientService;
|
|
|
|
@ -88,7 +88,7 @@ class ChangesCheckTest extends TestCase {
|
|
|
|
|
|
|
|
|
|
public function testCacheResultInsert() {
|
|
|
|
|
$version = '13.0.4';
|
|
|
|
|
$entry = $this->createMock(ChangesResult::class);
|
|
|
|
|
$entry = $this->createMock(Changes::class);
|
|
|
|
|
$entry->expects($this->exactly(2))
|
|
|
|
|
->method('__call')
|
|
|
|
|
->withConsecutive(['getVersion'], ['setVersion', [$version]])
|
|
|
|
@ -104,7 +104,7 @@ class ChangesCheckTest extends TestCase {
|
|
|
|
|
|
|
|
|
|
public function testCacheResultUpdate() {
|
|
|
|
|
$version = '13.0.4';
|
|
|
|
|
$entry = $this->createMock(ChangesResult::class);
|
|
|
|
|
$entry = $this->createMock(Changes::class);
|
|
|
|
|
$entry->expects($this->once())
|
|
|
|
|
->method('__call')
|
|
|
|
|
->willReturn($version);
|
|
|
|
@ -306,7 +306,7 @@ class ChangesCheckTest extends TestCase {
|
|
|
|
|
*/
|
|
|
|
|
public function testQueryChangesServer(string $etag) {
|
|
|
|
|
$uri = 'https://changes.nextcloud.server/?13.0.5';
|
|
|
|
|
$entry = $this->createMock(ChangesResult::class);
|
|
|
|
|
$entry = $this->createMock(Changes::class);
|
|
|
|
|
$entry->expects($this->any())
|
|
|
|
|
->method('__call')
|
|
|
|
|
->willReturn($etag);
|
|
|
|
@ -370,7 +370,7 @@ class ChangesCheckTest extends TestCase {
|
|
|
|
|
$this->expectException(DoesNotExistException::class);
|
|
|
|
|
$mocker->willThrowException(new DoesNotExistException('Changes info is not present'));
|
|
|
|
|
} else {
|
|
|
|
|
$entry = $this->createMock(ChangesResult::class);
|
|
|
|
|
$entry = $this->createMock(Changes::class);
|
|
|
|
|
$entry->expects($this->once())
|
|
|
|
|
->method('__call')
|
|
|
|
|
->with('getData')
|
|
|
|
@ -386,7 +386,7 @@ class ChangesCheckTest extends TestCase {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testGetChangesForVersionEmptyData() {
|
|
|
|
|
$entry = $this->createMock(ChangesResult::class);
|
|
|
|
|
$entry = $this->createMock(Changes::class);
|
|
|
|
|
$entry->expects($this->once())
|
|
|
|
|
->method('__call')
|
|
|
|
|
->with('getData')
|
|
|
|
|