Fix tests
parent
de5f7e3241
commit
dd8af946fd
|
@ -213,6 +213,7 @@ class ZipDownloader extends ArchiveDownloader
|
|||
$retval = $zipArchive->open($file);
|
||||
}
|
||||
|
||||
if (true === $retval) {
|
||||
$totalSize = 0;
|
||||
$archiveSize = filesize($file);
|
||||
$totalFiles = $zipArchive->count();
|
||||
|
@ -232,7 +233,6 @@ class ZipDownloader extends ArchiveDownloader
|
|||
}
|
||||
}
|
||||
|
||||
if (true === $retval) {
|
||||
$extractResult = $zipArchive->extractTo($path);
|
||||
|
||||
if (true === $extractResult) {
|
||||
|
|
|
@ -167,6 +167,9 @@ class ZipDownloaderTest extends TestCase
|
|||
$zipArchive->expects($this->once())
|
||||
->method('extractTo')
|
||||
->will($this->returnValue(true));
|
||||
$zipArchive->expects($this->once())
|
||||
->method('count')
|
||||
->will($this->returnValue(0));
|
||||
|
||||
$this->setPrivateProperty('zipArchiveObject', $zipArchive, $downloader);
|
||||
$promise = $downloader->extract($this->package, $this->filename, 'vendor/dir');
|
||||
|
@ -261,6 +264,9 @@ class ZipDownloaderTest extends TestCase
|
|||
$zipArchive->expects($this->once())
|
||||
->method('extractTo')
|
||||
->will($this->returnValue(true));
|
||||
$zipArchive->expects($this->once())
|
||||
->method('count')
|
||||
->will($this->returnValue(0));
|
||||
|
||||
$downloader = new MockedZipDownloader($this->io, $this->config, $this->httpDownloader, null, null, null, $processExecutor);
|
||||
$this->setPrivateProperty('zipArchiveObject', $zipArchive, $downloader);
|
||||
|
|
Loading…
Reference in New Issue