public static function PHPUnit_Framework_Assert::assertClassNotHasAttribute in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/phpunit/phpunit/src/Framework/Assert.php \PHPUnit_Framework_Assert::assertClassNotHasAttribute()
Asserts that a class does not have a specified attribute.
@since Method available since Release 3.1.0
Parameters
string $attributeName:
string $className:
string $message:
4 calls to PHPUnit_Framework_Assert::assertClassNotHasAttribute()
- Framework_AssertTest::testAssertClassNotHasAttributeThrowsException in vendor/
phpunit/ phpunit/ tests/ Framework/ AssertTest.php - @covers PHPUnit_Framework_Assert::assertClassNotHasAttribute @expectedException PHPUnit_Framework_Exception
- Framework_AssertTest::testAssertClassNotHasAttributeThrowsException2 in vendor/
phpunit/ phpunit/ tests/ Framework/ AssertTest.php - @covers PHPUnit_Framework_Assert::assertClassNotHasAttribute @expectedException PHPUnit_Framework_Exception
- Framework_AssertTest::testAssertClassNotHasAttributeThrowsExceptionIfAttributeNameIsNotValid in vendor/
phpunit/ phpunit/ tests/ Framework/ AssertTest.php - @covers PHPUnit_Framework_Assert::assertClassNotHasAttribute @expectedException PHPUnit_Framework_Exception
- Framework_AssertTest::testClassNotHasPublicAttribute in vendor/
phpunit/ phpunit/ tests/ Framework/ AssertTest.php - @covers PHPUnit_Framework_Assert::assertClassNotHasAttribute
File
- vendor/
phpunit/ phpunit/ src/ Framework/ Assert.php, line 1017
Class
- PHPUnit_Framework_Assert
- A set of assert methods.
Code
public static function assertClassNotHasAttribute($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_Not(new PHPUnit_Framework_Constraint_ClassHasAttribute($attributeName));
self::assertThat($className, $constraint, $message);
}