/** * Tests that the {@link PHP_Depend_Code_Method::setModifiers()} method * accepts the defined visibility value. * * @return void */ public function testSetModifiersAcceptsPrivateValue() { $method = new PHP_Depend_Code_Method('method'); $method->setModifiers(PHP_Depend_ConstantsI::IS_PRIVATE); self::assertTrue($method->isPrivate() && !$method->isPublic() && !$method->isProtected()); }
/** * Tests that the {@link PHP_Depend_Code_Method::setModifiers()} method * ignores repeated calls if the internal value is set. * * @return void * @group pdepend * @group pdepend::code * @group unittest */ public function testSetModifiersOnlyAcceptsTheFirstValue() { $method = new PHP_Depend_Code_Method('method'); $method->setModifiers(PHP_Depend_ConstantsI::IS_PUBLIC); $method->setModifiers(PHP_Depend_ConstantsI::IS_PROTECTED); self::assertTrue($method->isPublic()); }