Esempio n. 1
0
 function getTestStructure()
 {
     $myBookLoader = new bookLoader();
     $myBook = $myBookLoader->getBook('bulldoc_book');
     $struct = $myBook->getStructureHolder();
     return $struct;
 }
 function testIndexRender()
 {
     $bookKey = 'bulldoc_book';
     $myBookLoader = new bookLoader();
     $myBook = $myBookLoader->getBook('bulldoc_book');
     $render = $myBook->getBookRenderer();
     $html = $render->renderPage('/layout/index.html');
     $examinator = $this->getContentExaminator($html);
     echo $examinator->display();
     $this->assertEqual($examinator->getMD5(), '51783ae06f4f83baeaa6c2485aed4217', 'Index rendered');
 }
 function testShowTocForm()
 {
     $env = colesoApplication::getEnvironment();
     $env->method = 'GET';
     $bookLoader = new bookLoader();
     $parameters = array('bookKey' => 'bulldoc_book', 'bookLoader' => $bookLoader, 'book' => $bookLoader->getBook('bulldoc_book'), 'url' => 'introduction.html');
     $controller = new tocEditController();
     $controller->addParameters($parameters);
     $result = $controller->run();
     $examinator = $this->getContentExaminator($result->content);
     echo $examinator->display();
     $this->assertEqual($examinator->getMD5(), 'd9d5461896709de200ad36613e63f7d0', 'TOC Edit form rendered');
 }
 function testBook()
 {
     $sourcePath = colesoApplication::getConfigVal('/bulldoc/source');
     $outputPath = colesoApplication::getConfigVal('/bulldoc/output');
     $themesPath = colesoApplication::getConfigVal('/bulldoc/themeDir');
     $myBookLoader = new bookLoader();
     $myBook = $myBookLoader->getBook('bulldoc_book');
     $this->assertEqual($myBook->getBookDest(), $outputPath . 'bulldoc_book/', 'Correct Output Dest obtained');
     $this->assertEqual($myBook->getBookKey(), 'bulldoc_book', 'Book key Ok');
     $this->assertEqual($myBook->getBookData(), array('source' => $sourcePath . 'bulldoc_book/', 'title' => 'Bull Doc', 'author' => 'Dmitry Smirnov', 'copyright' => 'H-type, 2008', 'site' => 'www.bulldoc.ru', 'bookShelfTitle' => 'Bull Doc', 'outputMode' => 'html'), 'Correct book data array obtained');
     $this->assertEqual($myBook->getBookTitle(), 'Bull Doc', 'Book title Ok');
     $this->assertEqual($myBook->getBookSource(), $sourcePath . 'bulldoc_book/', 'Book source Ok');
     $this->assertEqual($myBook->getBookTheme(), array('themePath' => $themesPath . 'blueprint', 'themeUrl' => 'support/workshop/themes/blueprint'), 'Correct Theme data obtained');
     $this->assertEqual($myBook->getTocFileName(), $sourcePath . 'bulldoc_book/toc.yml', 'Correct TOC filename obtained');
     $this->assertIsA($myBook->getBookRenderer(), 'renderDocPage', 'book rendrer obtained');
 }
 function getIndexRender()
 {
     $myBookLoader = new bookLoader();
     $theme = new bulldocDecoThemes($myBookLoader->getBook('bulldoc_book')->getBookTheme());
     $myIndexRender = new IndexRender($this->getIndexBuilder(), $myBookLoader->getBook('bulldoc_book'), $theme);
     return $myIndexRender;
 }