Skip to content

Commit

Permalink
Allow installing/updating of apps again
Browse files Browse the repository at this point in the history
The Guzzle API changed. We shall now use sink

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
  • Loading branch information
rullzer committed Jan 12, 2021
1 parent c8cbb73 commit 9b58a02
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/private/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public function downloadApp($appId, $allowUnstable = false) {
$tempFile = $this->tempManager->getTemporaryFile('.tar.gz');
$timeout = $this->isCLI ? 0 : 120;
$client = $this->clientService->newClient();
$client->get($app['releases'][0]['download'], ['save_to' => $tempFile, 'timeout' => $timeout]);
$client->get($app['releases'][0]['download'], ['sink' => $tempFile, 'timeout' => $timeout]);

// Check if the signature actually matches the downloaded content
$certificate = openssl_get_publickey($app['certificate']);
Expand Down
10 changes: 5 additions & 5 deletions tests/lib/InstallerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ public function testDownloadAppWithInvalidSignature() {
$client
->expects($this->once())
->method('get')
->with('https://example.com', ['save_to' => $realTmpFile, 'timeout' => 120]);
->with('https://example.com', ['sink' => $realTmpFile, 'timeout' => 120]);
$this->clientService
->expects($this->once())
->method('newClient')
Expand Down Expand Up @@ -432,7 +432,7 @@ public function testDownloadAppWithMoreThanOneFolderDownloaded() {
$client
->expects($this->once())
->method('get')
->with('https://example.com', ['save_to' => $realTmpFile, 'timeout' => 120]);
->with('https://example.com', ['sink' => $realTmpFile, 'timeout' => 120]);
$this->clientService
->expects($this->once())
->method('newClient')
Expand Down Expand Up @@ -515,7 +515,7 @@ public function testDownloadAppWithMismatchingIdentifier() {
$client
->expects($this->once())
->method('get')
->with('https://example.com', ['save_to' => $realTmpFile, 'timeout' => 120]);
->with('https://example.com', ['sink' => $realTmpFile, 'timeout' => 120]);
$this->clientService
->expects($this->once())
->method('newClient')
Expand Down Expand Up @@ -594,7 +594,7 @@ public function testDownloadAppSuccessful() {
$client
->expects($this->once())
->method('get')
->with('https://example.com', ['save_to' => $realTmpFile, 'timeout' => 120]);
->with('https://example.com', ['sink' => $realTmpFile, 'timeout' => 120]);
$this->clientService
->expects($this->at(0))
->method('newClient')
Expand Down Expand Up @@ -680,7 +680,7 @@ public function testDownloadAppWithDowngrade() {
$client
->expects($this->once())
->method('get')
->with('https://example.com', ['save_to' => $realTmpFile, 'timeout' => 120]);
->with('https://example.com', ['sink' => $realTmpFile, 'timeout' => 120]);
$this->clientService
->expects($this->at(1))
->method('newClient')
Expand Down

0 comments on commit 9b58a02

Please sign in to comment.