public function testConstructSetsFields() { $title = $this->getMock('Title'); $children = array(new Page($this->getMock('Title')), new Page($this->getMock('Title'))); $page = new Page($title, $children); $this->assertEquals($title, $page->getTitle()); $this->assertEquals($children, $page->getSubPages()); }
/** * @see PageRenderer::renderPage * * @param Page $page * * @return string */ public function renderPage(Page $page) { $title = $page->getTitle(); if ($this->pathStyle === self::PATH_NONE) { return $this->getBaseText($title); } if ($this->pathStyle === self::PATH_NO_NS) { return $this->stripNs($title->getFullText()); } if ($this->pathStyle === self::PATH_SUB_PAGE) { return $title->getSubpageText(); } return $title->getFullText(); }
/** * @see PageRenderer::renderPage * * @param Page $page * * @return string */ public function renderPage(Page $page) { return '[[' . $page->getTitle()->getFullText() . '|' . $this->getLinkText($page) . ']]'; }