Add some unit tests
parent
1450ebd837
commit
9c739e71c2
|
@ -65,6 +65,21 @@ class FilesystemRepositoryTest extends \PHPUnit_Framework_TestCase
|
||||||
$repository->getPackages();
|
$repository->getPackages();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testUnexistentRepositoryFile()
|
||||||
|
{
|
||||||
|
$json = $this->createJsonFileMock();
|
||||||
|
|
||||||
|
$repository = new FilesystemRepository($json);
|
||||||
|
$repository->setRepositoryManager($this->getMock('Composer\Repository\RepositoryManager'));
|
||||||
|
|
||||||
|
$json
|
||||||
|
->expects($this->once())
|
||||||
|
->method('exists')
|
||||||
|
->will($this->returnValue(false));
|
||||||
|
|
||||||
|
$this->assertEquals(array(), $repository->getPackages());
|
||||||
|
}
|
||||||
|
|
||||||
public function testRepositoryWrite()
|
public function testRepositoryWrite()
|
||||||
{
|
{
|
||||||
$json = $this->createJsonFileMock();
|
$json = $this->createJsonFileMock();
|
||||||
|
|
Loading…
Reference in New Issue