Add test for getChildrenFor and getVersions

This commit is contained in:
Will Rossiter 2014-09-20 13:44:26 +12:00
parent cabda45f96
commit a4c32f0b25

View File

@ -91,34 +91,69 @@ class DocumentationManifestTests extends SapphireTest {
} }
public function testGetNextPage() { public function testGetNextPage() {
$this->markTestIncomplete();
} }
public function testGetPreviousPage() { public function testGetPreviousPage() {
$this->markTestIncomplete();
} }
public function testGetPage() { public function testGetPage() {
$this->markTestIncomplete();
} }
public function testGenerateBreadcrumbs() { public function testGenerateBreadcrumbs() {
$this->markTestIncomplete();
} }
public function testGetChildrenFor() { public function testGetChildrenFor() {
$expected = array(
array('Title' => 'Test', 'LinkingMode' => 'link')
);
$this->assertDOSContains($expected, $this->manifest->getChildrenFor(
DOCSVIEWER_PATH . "/tests/docs/en/"
));
$expected = array(
array('Title' => 'ChangeLog', 'LinkingMode' => 'current'),
array('Title' => 'Tutorials'),
array('Title' => 'Empty')
);
$this->assertDOSContains($expected, $this->manifest->getChildrenFor(
DOCSVIEWER_PATH . '/tests/docs-v3.0/en/',
DOCSVIEWER_PATH . '/tests/docs-v3.0/en/ChangeLog.md'
));
} }
public function testGetAllVersions() { public function testGetAllVersions() {
$expected = array(
'2.3' => '2.3',
'2.4' => '2.4',
'3.0' => '3.0'
);
$this->assertEquals($expected, $this->manifest->getAllVersions());
} }
public function testGetAllEntityVersions() { public function testGetAllEntityVersions() {
$expected = array(
'Version' => '2.3',
'Version' => '2.4',
'Version' => '3.0'
);
$entity = $this->manifest->getEntities()->find('Language', 'en');
$this->assertEquals(3, $this->manifest->getAllVersionsOfEntity($entity)->count());
$entity = $this->manifest->getEntities()->find('Language', 'de');
$this->assertEquals(1, $this->manifest->getAllVersionsOfEntity($entity)->count());
} }
public function testGetStableVersion() { public function testGetStableVersion() {
$this->markTestIncomplete();
} }
} }