You are here

public static function PHPUnit_Framework_Assert::assertClassNotHasStaticAttribute in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/src/Framework/Assert.php \PHPUnit_Framework_Assert::assertClassNotHasStaticAttribute()

Asserts that a class does not have 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::assertClassNotHasStaticAttribute()
Framework_AssertTest::testAssertClassNotHasStaticAttributeThrowsException in vendor/phpunit/phpunit/tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertClassNotHasStaticAttribute @expectedException PHPUnit_Framework_Exception
Framework_AssertTest::testAssertClassNotHasStaticAttributeThrowsException2 in vendor/phpunit/phpunit/tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertClassNotHasStaticAttribute @expectedException PHPUnit_Framework_Exception
Framework_AssertTest::testAssertClassNotHasStaticAttributeThrowsExceptionIfAttributeNameIsNotValid in vendor/phpunit/phpunit/tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertClassNotHasStaticAttribute @expectedException PHPUnit_Framework_Exception
Framework_AssertTest::testClassNotHasPublicStaticAttribute in vendor/phpunit/phpunit/tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertClassNotHasStaticAttribute

File

vendor/phpunit/phpunit/src/Framework/Assert.php, line 1075

Class

PHPUnit_Framework_Assert
A set of assert methods.

Code

public static function assertClassNotHasStaticAttribute($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_ClassHasStaticAttribute($attributeName));
  self::assertThat($className, $constraint, $message);
}