Fix typo & tests
parent
605e1cb925
commit
7cb79bb1c9
|
@ -59,7 +59,7 @@ abstract class ArchiveDownloader extends FileDownloader
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
// clean up
|
// clean up
|
||||||
$this->fs->removeDirectory($path);
|
$this->filesystem->removeDirectory($path);
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,7 @@ class FileDownloader implements DownloaderInterface
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
// clean up
|
// clean up
|
||||||
$this->fs->removeDirectory($path);
|
$this->filesystem->removeDirectory($path);
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ class FileDownloader implements DownloaderInterface
|
||||||
*/
|
*/
|
||||||
public function remove(PackageInterface $package, $path)
|
public function remove(PackageInterface $package, $path)
|
||||||
{
|
{
|
||||||
$this->fs->removeDirectory($path);
|
$this->filesystem->removeDirectory($path);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -39,7 +39,7 @@ class FileDownloaderTest extends \PHPUnit_Framework_TestCase
|
||||||
$downloader->download($packageMock, '/path');
|
$downloader->download($packageMock, '/path');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDownloadToExistFile()
|
public function testDownloadToExistingFile()
|
||||||
{
|
{
|
||||||
$packageMock = $this->getMock('Composer\Package\PackageInterface');
|
$packageMock = $this->getMock('Composer\Package\PackageInterface');
|
||||||
$packageMock->expects($this->once())
|
$packageMock->expects($this->once())
|
||||||
|
@ -57,7 +57,7 @@ class FileDownloaderTest extends \PHPUnit_Framework_TestCase
|
||||||
if (file_exists($path)) {
|
if (file_exists($path)) {
|
||||||
unset($path);
|
unset($path);
|
||||||
}
|
}
|
||||||
$this->assertInstanceOf('UnexpectedValueException', $e);
|
$this->assertInstanceOf('RuntimeException', $e);
|
||||||
$this->assertContains('exists and is not a directory', $e->getMessage());
|
$this->assertContains('exists and is not a directory', $e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue