PHPUnit_Framework_Assert::classHasStaticAttribute PHP Method

classHasStaticAttribute() public static method

Returns a PHPUnit_Framework_Constraint_ClassHasStaticAttribute matcher object.
public static classHasStaticAttribute ( string $attributeName ) : PHPUnit_Framework_Constraint_ClassHasStaticAttribute
$attributeName string
return PHPUnit_Framework_Constraint_ClassHasStaticAttribute
    public static function classHasStaticAttribute($attributeName)
    {
        return new PHPUnit_Framework_Constraint_ClassHasStaticAttribute($attributeName);
    }

Usage Example

 /**
  * @covers PHPUnit_Framework_Constraint_ClassHasStaticAttribute
  * @covers PHPUnit_Framework_Constraint_Not
  * @covers PHPUnit_Framework_Assert::classHasStaticAttribute
  * @covers PHPUnit_Framework_Assert::logicalNot
  */
 public function testConstraintClassNotHasStaticAttribute2()
 {
     $constraint = PHPUnit_Framework_Assert::logicalNot(PHPUnit_Framework_Assert::classHasStaticAttribute('notExistingAttribute'));
     try {
         $constraint->fail('ClassWithNonPublicAttributes', 'custom message', TRUE);
     } catch (PHPUnit_Framework_ExpectationFailedException $e) {
         $this->assertEquals("custom message\nFailed asserting that class \"ClassWithNonPublicAttributes\" does not have static attribute \"notExistingAttribute\".", $e->getDescription());
         return;
     }
     $this->fail();
 }
All Usage Examples Of PHPUnit_Framework_Assert::classHasStaticAttribute
PHPUnit_Framework_Assert