Improving test coverage

This commit is contained in:
Klaus Silveira
2012-05-23 03:57:02 -03:00
parent de57d7d489
commit b09076c37a

View File

@@ -152,10 +152,28 @@ class ClientTest extends PHPUnit_Framework_TestCase
$this->assertRegExp("/new file: test_file5.txt/", $repository->getClient()->run($repository, 'status'));
$this->assertRegExp("/new file: test_file6.txt/", $repository->getClient()->run($repository, 'status'));
}
/**
* @depends testIsAddingAll
*/
public function testIsAddingArrayOfFiles()
{
$repository = $this->client->getRepository($this->repoPath);
file_put_contents($this->repoPath . '/test_file7.txt', 'Your mother is so ugly, glCullFace always returns TRUE.');
file_put_contents($this->repoPath . '/test_file8.txt', 'Your mother is so ugly, glCullFace always returns TRUE.');
file_put_contents($this->repoPath . '/test_file9.txt', 'Your mother is so ugly, glCullFace always returns TRUE.');
$repository->add(array('test_file7.txt', 'test_file8.txt', 'test_file9.txt'));
$this->assertRegExp("/new file: test_file7.txt/", $repository->getClient()->run($repository, 'status'));
$this->assertRegExp("/new file: test_file8.txt/", $repository->getClient()->run($repository, 'status'));
$this->assertRegExp("/new file: test_file9.txt/", $repository->getClient()->run($repository, 'status'));
}
/**
* @depends testIsAddingArrayOfFiles
*/
public function testIsCommiting()
{
$repository = $this->client->getRepository($this->repoPath);
@@ -332,10 +350,10 @@ class ClientTest extends PHPUnit_Framework_TestCase
$repository = $this->client->getRepository($this->repoPath);
$stats = $repository->getStatistics('master');
$this->assertEquals('7', $stats['extensions']['.txt']);
$this->assertEquals('10', $stats['extensions']['.txt']);
$this->assertEquals('5', $stats['extensions']['.php']);
$this->assertEquals('515', $stats['size']);
$this->assertEquals('12', $stats['files']);
$this->assertEquals('680', $stats['size']);
$this->assertEquals('15', $stats['files']);
}
public function testIsGettingAuthorStatistics()