mirror of
https://github.com/composer/composer
synced 2025-05-09 08:32:56 +00:00
Add some unit tests
This commit is contained in:
parent
1450ebd837
commit
9c739e71c2
1 changed files with 15 additions and 0 deletions
|
@ -65,6 +65,21 @@ class FilesystemRepositoryTest extends \PHPUnit_Framework_TestCase
|
|||
$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()
|
||||
{
|
||||
$json = $this->createJsonFileMock();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue