/** * testRestoreFunctionAddsFunctionToPackage * * @return void */ public function testRestoreFunctionAddsFunctionToPackage() { $builder = $this->createBuilder(); $package = $builder->buildPackage(__CLASS__); $function = new PHP_Depend_Code_Function(__FUNCTION__); $function->setPackage($package); $builder->restoreFunction($function); self::assertEquals(1, count($package->getFunctions())); }
/** * Tests that the {@link PHP_Depend_Code_Function::getPackage()} returns as * default value <b>null</b> and that the package could be set and unset. * * @return void */ public function testGetSetPackage() { $package = new PHP_Depend_Code_Package('package'); $function = new PHP_Depend_Code_Function('func'); $function->setPackage($package); $this->assertSame($package, $function->getPackage()); }