mirror of
https://github.com/silverstripe/silverstripe-docsviewer
synced 2024-10-22 11:05:56 +02:00
277bca7b11
ENHANCEMENT Saving $ModuleName in viewer instead of getting it from Remaining[0] MINOR Don't include version in breadcrumbs, doesn't make sense in this context (e.g. "2.4/en/cms", the "2.4" part is connecte to the cms module, hence an index of all versions regardless of module is not very useful)
21 lines
688 B
PHP
21 lines
688 B
PHP
<?php
|
|
/**
|
|
* @package sapphiredocs
|
|
*/
|
|
class DocumentationEntityTest extends SapphireTest {
|
|
|
|
function testDocumentationEntityAccessing() {
|
|
$entity = new DocumentationEntity('docs', '1.0', '../sapphiredocs/tests/docs/', 'My Test');
|
|
|
|
$this->assertEquals($entity->getTitle(), 'My Test');
|
|
$this->assertEquals($entity->getVersions(), array('1.0'));
|
|
$this->assertEquals($entity->getLanguages(), array('en', 'de'));
|
|
$this->assertEquals($entity->getModuleFolder(), 'docs');
|
|
|
|
$this->assertTrue($entity->hasVersion('1.0'));
|
|
$this->assertFalse($entity->hasVersion('2.0'));
|
|
|
|
$this->assertTrue($entity->hasLanguage('en'));
|
|
$this->assertFalse($entity->hasLanguage('fr'));
|
|
}
|
|
} |