/** * @return void * @covers \pdepend\reflection\api\StaticReflectionClass * @group reflection * @group reflection::api * @group unittest */ public function testIsAbstractReturnsTrueWhenClassContainsAnAbstractMethod() { $class = new StaticReflectionClass(__CLASS__, '', 0); $class->initMethods(array(new StaticReflectionMethod('foo', '', StaticReflectionMethod::IS_ABSTRACT))); $this->assertTrue($class->isAbstract()); }
/** * @return void * @covers \pdepend\reflection\api\StaticReflectionMethod * @group reflection * @group reflection::api * @group unittest */ public function testIsConstructorReturnsFalseForPhp4StyleMethodWhenConstructMethodExists() { $method0 = new StaticReflectionMethod('__construct', '', 0); $method1 = new StaticReflectionMethod('stdClass', '', 0); $class = new StaticReflectionClass('\\stdClass', '', 0); $class->initMethods(array($method0, $method1)); $this->assertFalse($method1->isConstructor()); }
/** * testGetPrototypeParentClassHidesParentInterface * * @return void * @covers \pdepend\reflection\api\StaticReflectionMethod * @group reflection * @group reflection::api * @group unittest */ public function testGetPrototypeParentClassHidesParentInterface() { $method = new StaticReflectionMethod('foo', '', 0); $interface = new StaticReflectionInterface('IFoo', ''); $interface->initMethods(array(new StaticReflectionMethod('foo', '', 0))); $declaringClass = new StaticReflectionClass('Bar', '', 0); $declaringClass->initMethods(array($method)); $declaringClass->initInterfaces(array($interface)); $this->assertSame($interface, $method->getPrototype()->getDeclaringClass()); }