/**
  * Shows correct behavior for adding a private page object,
  * when the privatepages array is completely empty
  * @since 1.4.0a2
  */
 public function testShowCorrectBehaviorWhenPrivatePageArrayIsEmpty()
 {
     $this->ip->addPrivatePage($this->pp, $this->path);
     // verify parent attributes are set correctly
     $this->assertEquals($this->ip->privatepages[$this->path]->parent->type, "page");
     $this->assertEquals($this->ip->privatepages[$this->path]->parent->id, "");
     $this->assertEquals($this->ip->privatepages[$this->path]->parent->file, "");
     $this->assertEquals($this->ip->privatepages[$this->path]->parent->sourceLocation, "");
     $this->assertEquals($this->ip->privatepages[$this->path]->parent->name, "");
     $this->assertEquals($this->ip->privatepages[$this->path]->parent->origName, "");
     $this->assertEquals($this->ip->privatepages[$this->path]->parent->category, "default");
     $this->assertEquals($this->ip->privatepages[$this->path]->parent->package, "default");
     $this->assertEquals($this->ip->privatepages[$this->path]->parent->subpackage, "");
     /**
      * don't bother checking '[$this->path]->parent->parserVersion,
      * because it will change between PhpDocumentor versions,
      * and we don't want to keep it hand-updated in here
      */
     $this->assertEquals($this->ip->privatepages[$this->path]->parent->modDate, "");
     $this->assertEquals($this->ip->privatepages[$this->path]->parent->path, "");
     $this->assertEquals($this->ip->privatepages[$this->path]->parent->packageOutput, "");
     // now verify current page attributes are set correctly
     $this->assertEquals($this->ip->privatepages[$this->path]->elements, array());
     $this->assertEquals($this->ip->privatepages[$this->path]->_hasclasses, "");
     $this->assertEquals($this->ip->privatepages[$this->path]->_hasinterfaces, "");
     $this->assertEquals($this->ip->privatepages[$this->path]->privateelements, array());
     $this->assertEquals($this->ip->privatepages[$this->path]->classelements, array());
     $this->assertEquals($this->ip->privatepages[$this->path]->tutorial, "");
     $this->assertEquals($this->ip->privatepages[$this->path]->privateclasselements, array());
     $this->assertEquals($this->ip->privatepages[$this->path]->links, array());
     $this->assertEquals($this->ip->privatepages[$this->path]->clean, true);
     $this->assertEquals($this->ip->privatepages[$this->path]->docblock, "");
     $this->assertEquals($this->ip->privatepages[$this->path]->_explicitdocblock, "");
     $this->assertEquals($this->ip->privatepages[$this->path]->type, "page");
 }
Example #2
0
 /**
  * Figures out what output converter to use
  * @param string Output Converter Template name
  * @access private
  * @global array
  * @uses cleanConverterNamePieces
  * @uses phpDocumentor_out
  */
 function setupConverters($output = false)
 {
     global $_phpDocumentor_setting;
     if ($output) {
         $_phpDocumentor_setting['output'] = $output;
     }
     if (isset($_phpDocumentor_setting['output']) && !empty($_phpDocumentor_setting['output'])) {
         $c = explode(',', $_phpDocumentor_setting['output']);
         for ($i = 0; $i < count($c); $i++) {
             $c[$i] = explode(':', $c[$i]);
             $a = $c[$i][0];
             if (isset($c[$i][0])) {
                 $a = $this->cleanConverterNamePiece($c[$i][0]);
             } else {
                 $a = false;
             }
             if (isset($c[$i][1])) {
                 /*
                  * must allow "/" due to options like "DocBook/peardoc2"
                  */
                 $b = $this->cleanConverterNamePiece($c[$i][1], '\\/');
             } else {
                 $b = false;
             }
             if (isset($c[$i][2])) {
                 /*
                  * must allow "." due to options like "phpdoc.de"
                  * must allow "/" due to options like "DOM/default"
                  */
                 $d = $this->cleanConverterNamePiece($c[$i][2], '.\\/');
                 if (substr($d, -1) != "/") {
                     $d .= "/";
                 } else {
                     $d = 'default/';
                 }
             }
             if (strtoupper(trim($a)) == 'HTML' && trim($b) == 'default') {
                 phpDocumentor_out("WARNING: HTMLdefaultConverter is deprecated, using HTMLframesConverter.\n");
                 phpDocumentor_out("WARNING: template output is identical, HTMLframes is more flexible.\n");
                 phpDocumentor_out("WARNING: please adjust your usage\n");
                 flush();
                 $b = 'frames';
                 // change default to frames.
             }
             $this->render->addConverter(strtoupper(trim($a)), trim($b), trim($d));
         }
     } else {
         $this->render->addConverter('HTML', 'frames', 'default/');
     }
     if (empty($this->render->converters)) {
         addErrorDie(PDERROR_NO_CONVERTERS);
     }
 }
 function setupConverters($output = false)
 {
     global $_phpDocumentor_setting;
     if ($output) {
         $_phpDocumentor_setting['output'] = $output;
     }
     if (isset($_phpDocumentor_setting['output']) && !empty($_phpDocumentor_setting['output'])) {
         $c = explode(',', $_phpDocumentor_setting['output']);
         for ($i = 0; $i < count($c); $i++) {
             $c[$i] = explode(':', $c[$i]);
             $a = $c[$i][0];
             $b = false;
             $d = 'default/';
             if (count($c[$i]) > 1) {
                 $a = $c[$i][0];
                 $b = $c[$i][1];
                 if (isset($c[$i][2])) {
                     $d = $c[$i][2];
                     $d = str_replace("\\", "/", $d);
                     if (substr($d, -1) != "/") {
                         $d .= "/";
                     }
                 } else {
                     $d = 'default/';
                 }
             }
             if (strtoupper(trim($a)) == 'HTML' && trim($b) == 'default') {
                 phpDocumentor_out("WARNING: HTMLdefaultConverter is deprecated, using HTMLframesConverter.\n");
                 phpDocumentor_out("WARNING: template output is identical, HTMLframes is more flexible.\n");
                 phpDocumentor_out("WARNING: please adjust your usage\n");
                 flush();
                 $b = 'frames';
                 // change default to frames.
             }
             $this->render->addConverter(strtoupper(trim($a)), trim($b), trim($d));
         }
     } else {
         $this->render->addConverter('HTML', 'frames', 'default/');
     }
     if (empty($this->render->converters)) {
         addErrorDie(PDERROR_NO_CONVERTERS);
     }
 }