Skip to content

Commit 158879a

Browse files
author
alexandresalome
committed
empty reference bag error
1 parent 73febaf commit 158879a

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

tests/Gitonomy/Git/Tests/AbstractTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,17 @@ public static function provideFoobar()
5656
);
5757
}
5858

59+
/**
60+
* Can be used as data provider to get bare/not-bare repositories.
61+
*/
62+
public static function provideEmpty()
63+
{
64+
return array(
65+
array(self::createEmptyRepository()),
66+
array(self::createEmptyRepository(false))
67+
);
68+
}
69+
5970
/**
6071
* Creates a fixture test repository.
6172
*

tests/Gitonomy/Git/Tests/ReferenceTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ class ReferenceTest extends AbstractTest
1919
{
2020
private $references;
2121

22+
/**
23+
* @dataProvider provideEmpty
24+
*/
25+
public function testEmptyRepository($repository)
26+
{
27+
$this->assertCount(0, $repository->getReferences());
28+
$this->assertEquals(array(), $repository->getReferences()->getAll());
29+
}
30+
2231
/**
2332
* @dataProvider provideFoobar
2433
*/

0 commit comments

Comments
 (0)