예제 #1
0
 /**
  * Tests the behavior of {@link PHP_Depend_Code_Function::findChildrenOfType()}.
  *
  * @return void
  */
 public function testFindChildrenOfTypeReturnsExpectedResult()
 {
     $node1 = $this->getMock('PHP_Depend_Code_ASTNodeI', array(), array(), 'PHP_Depend_Code_ASTNodeI_' . md5(microtime()));
     $node1->expects($this->once())->method('findChildrenOfType')->will($this->returnValue(array()));
     $node2 = $this->getMock('PHP_Depend_Code_ASTNodeI', array(), array(), 'PHP_Depend_Code_ASTNodeI_' . md5(microtime()));
     $node2->expects($this->once())->method('findChildrenOfType')->will($this->returnValue(array()));
     $function = new PHP_Depend_Code_Function('Method');
     $function->addChild($node1);
     $function->addChild($node2);
     $children = $function->findChildrenOfType(get_class($node2));
     $this->assertSame(array($node2), $children);
 }