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

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

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