PHPUnit_Framework_Assert::getStaticAttribute PHP Method

getStaticAttribute() public static method

This also works for attributes that are declared protected or private.
public static getStaticAttribute ( string $className, string $attributeName ) : mixed
$className string
$attributeName string
return mixed
    public static function getStaticAttribute($className, $attributeName)
    {
        if (!is_string($className)) {
            throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string');
        }
        if (!class_exists($className)) {
            throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'class name');
        }
        if (!is_string($attributeName)) {
            throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'string');
        }
        if (!preg_match('/[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*/', $attributeName)) {
            throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'valid attribute name');
        }
        $class = new ReflectionClass($className);
        while ($class) {
            $attributes = $class->getStaticProperties();
            if (array_key_exists($attributeName, $attributes)) {
                return $attributes[$attributeName];
            }
            $class = $class->getParentClass();
        }
        throw new PHPUnit_Framework_Exception(sprintf('Attribute "%s" not found in class.', $attributeName));
    }
PHPUnit_Framework_Assert