/** * Tests that build interface updates the source file information for null * values. * * @return void */ public function testSetSourceFileInformationForNullValue() { $file = new PHP_Depend_Code_File(__FILE__); $class = new PHP_Depend_Code_Class(__CLASS__); $class->setSourceFile($file); $method = new PHP_Depend_Code_Method(__FUNCTION__); $method->setParent($class); self::assertSame($file, $method->getSourceFile()); }
/** * Visits a method node. * * @param PHP_Depend_Code_Method $node The method class node. * * @return void * @see PHP_Depend_VisitorI::visitMethod() */ public function visitMethod(PHP_Depend_Code_Method $node) { if ($node->getSourceFile()->getFileName() === null) { return; } $this->_apply(new PHP_PMD_Node_Method($node)); }
/** * Tests that build interface updates the source file information for null * values. * * @return void */ public function testSetSourceFileInformationForNullValue() { $method = new PHP_Depend_Code_Method('method'); $file = new PHP_Depend_Code_File(__FILE__); $method->setSourceFile($file); $this->assertSame($file, $method->getSourceFile()); }