Exemplo n.º 1
0
 private function makeTitleOf($page)
 {
     if ($page instanceof DIWikiPage) {
         return $page->getTitle();
     }
     if ($page instanceof Title) {
         return $page;
     }
     return $this->titleCreator->createFromText($page);
 }
 private function normalizeBulkOfPages(&$pages)
 {
     $titleCache = array();
     foreach ($pages as $key => &$page) {
         if ($page instanceof DIWikiPage) {
             $page = $page->getTitle();
         }
         if (!$page instanceof Title) {
             $page = $this->titleCreator->createFromText($page);
         }
         // Filter out pages with fragments (subobjects)
         if (isset($titleCache[$page->getPrefixedDBkey()])) {
             unset($pages[$key]);
         } else {
             $titleCache[$page->getPrefixedDBkey()] = true;
         }
     }
     unset($titleCache);
 }
 public function testCreateTitleFromText()
 {
     $instance = new TitleCreator();
     $this->assertInstanceOf('\\Title', $instance->createFromText(__METHOD__));
 }