2010-08-01 06:46:32 +02:00
|
|
|
<?php
|
|
|
|
class DocumentationPageTest extends SapphireTest {
|
|
|
|
|
|
|
|
function testGetRelativePath() {
|
2010-10-21 22:27:23 +02:00
|
|
|
$page = new DocumentationPage();
|
|
|
|
$page->setRelativePath('test.md');
|
|
|
|
$page->setEntity(new DocumentationEntity('mymodule', null, BASE_PATH . '/sapphiredocs/tests/docs/'));
|
|
|
|
|
2010-08-01 06:46:32 +02:00
|
|
|
$this->assertEquals('test.md', $page->getRelativePath());
|
|
|
|
|
2010-10-21 22:27:23 +02:00
|
|
|
$page = new DocumentationPage();
|
|
|
|
$page->setRelativePath('subfolder/subpage.md');
|
|
|
|
$page->setEntity(new DocumentationEntity('mymodule', null, BASE_PATH . '/sapphiredocs/tests/docs/'));
|
|
|
|
|
2010-08-01 06:46:32 +02:00
|
|
|
$this->assertEquals('subfolder/subpage.md', $page->getRelativePath());
|
|
|
|
}
|
|
|
|
|
|
|
|
function testGetPath() {
|
|
|
|
$absPath = BASE_PATH . '/sapphiredocs/tests/docs/';
|
2010-10-21 22:27:23 +02:00
|
|
|
$page = new DocumentationPage();
|
|
|
|
$page->setRelativePath('test.md');
|
|
|
|
$page->setEntity(new DocumentationEntity('mymodule', null, $absPath));
|
|
|
|
|
2010-08-01 06:46:32 +02:00
|
|
|
$this->assertEquals($absPath . 'en/test.md', $page->getPath());
|
|
|
|
|
2010-10-21 22:27:23 +02:00
|
|
|
$page = new DocumentationPage();
|
|
|
|
$page->setRelativePath('subfolder/subpage.md');
|
|
|
|
$page->setEntity(new DocumentationEntity('mymodule', null, $absPath));
|
|
|
|
|
2010-08-01 06:46:32 +02:00
|
|
|
$this->assertEquals($absPath . 'en/subfolder/subpage.md', $page->getPath());
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|