コード例 #1
0
ファイル: ClassTest.php プロジェクト: rouffj/pdepend
 /**
  * Tests the behavior of {@link PHP_Depend_Code_Method::getFirstChildOfType()}.
  *
  * @return void
  */
 public function testGetFirstChildOfTypeReturnsTheExpectedNull()
 {
     $node1 = $this->getMock('PHP_Depend_Code_ASTNodeI', array(), array(), 'PHP_Depend_Code_ASTNodeI_' . md5(microtime()));
     $node1->expects($this->once())->method('getFirstChildOfType')->will($this->returnValue(null));
     $node2 = $this->getMock('PHP_Depend_Code_ASTNodeI', array(), array(), 'PHP_Depend_Code_ASTNodeI_' . md5(microtime()));
     $node2->expects($this->once())->method('getFirstChildOfType')->will($this->returnValue(null));
     $class = new PHP_Depend_Code_Class('Clazz');
     $class->setCache(new PHP_Depend_Util_Cache_Driver_Memory());
     $class->addChild($node1);
     $class->addChild($node2);
     $child = $class->getFirstChildOfType('PHP_Depend_Code_ASTNodeI_' . md5(microtime()));
     self::assertNull($child);
 }