Exemplo n.º 1
0
 /**
  * save the entry in the index for a ClassDocumentor object
  *
  * @param object $classDoc Instance of ClassDocumentor to add to database.
  * @return boolean success
  **/
 public function saveClassDocs(ClassDocumentor $classDoc)
 {
     $classDoc->getAll();
     $slug = $this->_makeSlug($classDoc->name);
     $new = array('name' => $classDoc->name, 'slug' => $slug, 'file_name' => $classDoc->classInfo['fileName'], 'method_index' => $this->_generateIndex($classDoc, 'methods'), 'property_index' => $this->_generateIndex($classDoc, 'properties'), 'flags' => ApiClass::CONCRETE_CLASS);
     $this->set($new);
     return $this->save();
 }
Exemplo n.º 2
0
 /**
  * test function signature making
  *
  * @return void
  **/
 function testMakeFunctionSignature()
 {
     App::import('Lib', array('ApiGenerator.FunctionDocumentor', 'ApiGenerator.ClassDocumentor'));
     $Func = new FunctionDocumentor('count');
     $result = DocblockTools::makeFunctionSignature($Func);
     $expected = 'count( $var, $mode )';
     $this->assertEqual($result, $expected);
     $Class = new ClassDocumentor('ClassDocumentor');
     $function = $Class->getMethod('_parseComment');
     $result = DocblockTools::makeFunctionSignature($function);
     $expected = '_parseComment( $comments )';
     $this->assertEqual($result, $expected);
 }
 function testHasParentProperties()
 {
     $docs = new ClassDocumentor('SimpleDocumentorSubjectClass');
     $this->assertFalse($docs->hasParentProperties());
     $docs = new ClassDocumentor(get_class($this));
     $this->assertTrue($docs->hasParentProperties());
 }