public static function PHPUnit_Framework_Assert::assertClassHasStaticAttribute in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/phpunit/phpunit/src/Framework/Assert.php \PHPUnit_Framework_Assert::assertClassHasStaticAttribute()
Asserts that a class has a specified static attribute.
@since Method available since Release 3.1.0
Parameters
string $attributeName:
string $className:
string $message:
4 calls to PHPUnit_Framework_Assert::assertClassHasStaticAttribute()
- Framework_AssertTest::testAssertClassHasStaticAttributeThrowsException in vendor/
phpunit/ phpunit/ tests/ Framework/ AssertTest.php - @covers PHPUnit_Framework_Assert::assertClassHasStaticAttribute @expectedException PHPUnit_Framework_Exception
- Framework_AssertTest::testAssertClassHasStaticAttributeThrowsException2 in vendor/
phpunit/ phpunit/ tests/ Framework/ AssertTest.php - @covers PHPUnit_Framework_Assert::assertClassHasStaticAttribute @expectedException PHPUnit_Framework_Exception
- Framework_AssertTest::testAssertClassHasStaticAttributeThrowsExceptionIfAttributeNameIsNotValid in vendor/
phpunit/ phpunit/ tests/ Framework/ AssertTest.php - @covers PHPUnit_Framework_Assert::assertClassHasStaticAttribute @expectedException PHPUnit_Framework_Exception
- Framework_AssertTest::testClassHasPublicStaticAttribute in vendor/
phpunit/ phpunit/ tests/ Framework/ AssertTest.php - @covers PHPUnit_Framework_Assert::assertClassHasStaticAttribute
File
- vendor/
phpunit/ phpunit/ src/ Framework/ Assert.php, line 1046
Class
- PHPUnit_Framework_Assert
- A set of assert methods.
Code
public static function assertClassHasStaticAttribute($attributeName, $className, $message = '') {
if (!is_string($attributeName)) {
throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string');
}
if (!preg_match('/[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*/', $attributeName)) {
throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'valid attribute name');
}
if (!is_string($className) || !class_exists($className)) {
throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'class name', $className);
}
$constraint = new PHPUnit_Framework_Constraint_ClassHasStaticAttribute($attributeName);
self::assertThat($className, $constraint, $message);
}