/** * Tests the behavior of {@link \PDepend\Source\AST\ASTMethod::getFirstChildOfType()}. * * @return void */ public function testGetFirstChildOfTypeReturnsTheExpectedNull() { $node1 = $this->getMock('PDepend\\Source\\AST\\ASTNode', array(), array(), 'Class_' . __FUNCTION__ . '_' . md5(microtime())); $node1->expects($this->once())->method('getFirstChildOfType')->will($this->returnValue(null)); $node2 = $this->getMock('PDepend\\Source\\AST\\ASTNode', array(), array(), 'Class_' . __FUNCTION__ . '_' . md5(microtime())); $node2->expects($this->once())->method('getFirstChildOfType')->will($this->returnValue(null)); $class = new ASTClass('Clazz'); $class->setCache(new MemoryCacheDriver()); $class->addChild($node1); $class->addChild($node2); $child = $class->getFirstChildOfType('Class_' . __FUNCTION__ . '_' . md5(microtime())); $this->assertNull($child); }