public function testAddDescription()
 {
     $ns = Localizer::getInstance()->getNamespaceTextById(NS_CATEGORY);
     $instance = new ClassDescription(new DIWikiPage('Foo', NS_CATEGORY));
     $instance->addDescription(new ClassDescription(new DIWikiPage('Bar', NS_CATEGORY)));
     $this->assertEquals("[[{$ns}:Foo||Bar]]", $instance->getQueryString());
     $this->assertEquals(" <q>[[{$ns}:Foo||Bar]]</q> ", $instance->getQueryString(true));
 }
 public function prune(&$maxsize, &$maxdepth, &$log)
 {
     if ($maxsize >= $this->getSize()) {
         $maxsize = $maxsize - $this->getSize();
         return $this;
     } elseif ($maxsize <= 0) {
         $log[] = $this->getQueryString();
         $result = new ThingDescription();
     } else {
         $result = new ClassDescription(array_slice($this->m_diWikiPages, 0, $maxsize));
         $rest = new ClassDescription(array_slice($this->m_diWikiPages, $maxsize));
         $log[] = $rest->getQueryString();
         $maxsize = 0;
     }
     $result->setPrintRequests($this->getPrintRequests());
     return $result;
 }