/** * Checks that the reflected class is a child of the given class name. * * @param string $class Name of the searched class. * * @return boolean */ public function isSubclassOf($class) { if ($this->_parentClass === false) { return parent::isSubclassOf($class); } else { if (strcasecmp($this->_parentClass->getName(), ltrim($class, '\\')) === 0) { return true; } } return $this->_parentClass->isSubclassOf($class); }
/** * @return void * @covers \pdepend\reflection\api\StaticReflectionInterface * @group reflection * @group reflection::api * @group unittest */ public function testIsSubclassOfReturnsFalseOnClaseItSelf() { $interface = new StaticReflectionInterface(__CLASS__, ''); $this->assertFalse($interface->isSubclassOf(__CLASS__)); }