1
0
Fork 0

Add some unit tests

pull/71/head
Fabien Potencier 2011-10-30 09:10:49 +01:00
parent 1450ebd837
commit 9c739e71c2
1 changed files with 15 additions and 0 deletions

View File

@ -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();