lithium\test\Unit::assertClassHasStaticAttribute PHP Метод

assertClassHasStaticAttribute() публичный Метод

$this->assertClassHasStaticAttribute('_methodFilters', '\lithium\core\StaticObject'); // succeeds $this->assertClassHasStaticAttribute('foobar', '\lithium\core\StaticObject'); // fails
См. также: lithium\test\Unit::assert()
public assertClassHasStaticAttribute ( mixed $attributeName, string $class, string | boolean $message = '{:message}' ) : boolean
$attributeName mixed
$class string
$message string | boolean
Результат boolean `true` if the assertion succeeded, `false` otherwise.
    public function assertClassHasStaticAttribute($attributeName, $class, $message = '{:message}')
    {
        $object = new ReflectionClass($class);
        if ($object->hasProperty($attributeName)) {
            $attribute = $object->getProperty($attributeName);
            return $this->assert($attribute->isStatic(), $message, array('expected' => $attributeName, 'result' => $object->getProperties()));
        }
        return $this->assert(false, $message, array('expected' => $attributeName, 'result' => $object->getProperties()));
    }