コード例 #1
0
 /**
  * Tests the getMethod method
  *
  * @covers \phpDocumentor\Reflection\ClassReflector::getMethod
  *
  * @return void
  */
 public function testGetMethod()
 {
     $node = new NodeStmtMock();
     $node->stmts = array(new ClassMethod('someMethod'));
     $class_reflector = new ClassReflectorMock($node, new Context());
     // Before parseSubElements
     $this->assertNull($class_reflector->getMethod('someMethod'));
     $class_reflector->parseSubElements();
     // After parseSubElements
     $this->assertInstanceOf('\\phpDocumentor\\Reflection\\ClassReflector\\MethodReflector', $class_reflector->getMethod('someMethod'));
     $this->assertNull($class_reflector->getMethod('someOtherMethod'));
 }
コード例 #2
0
 /**
  * Tests the parseSubElements method
  *
  * @covers \phpDocumentor\Reflection\ClassReflector::getInterfaces
  *
  * @return void
  */
 public function testGetInterfaces()
 {
     $node = new NodeStmtMock();
     $class_reflector = new ClassReflectorMock($node, new Context());
     $this->assertEquals(array(), $class_reflector->getInterfaces());
     $node->implements = array('dummy');
     $this->assertEquals(array('\\dummy'), $class_reflector->getInterfaces());
 }