file-fetcher
Public Member Functions | Protected Member Functions | List of all members
PHPUnit\Framework\Constraint\ClassHasAttribute Class Reference
Inheritance diagram for PHPUnit\Framework\Constraint\ClassHasAttribute:
PHPUnit\Framework\Constraint\Constraint PHPUnit\Framework\SelfDescribing PHPUnit\Framework\Constraint\ClassHasStaticAttribute PHPUnit\Framework\Constraint\ObjectHasAttribute

Detailed Description

Constraint that asserts that the class it is evaluated for has a given attribute.

The attribute name is passed in the constructor.

Public Member Functions

 __construct (string $attributeName)
 
 toString ()
 
- Public Member Functions inherited from PHPUnit\Framework\Constraint\Constraint
 evaluate ($other, string $description='', bool $returnResult=false)
 
 count ()
 

Protected Member Functions

 matches ($other)
 
 failureDescription ($other)
 
 attributeName ()
 
- Protected Member Functions inherited from PHPUnit\Framework\Constraint\Constraint
 exporter ()
 
 fail ($other, $description, ComparisonFailure $comparisonFailure=null)
 
 additionalFailureDescription ($other)
 

Constructor & Destructor Documentation

◆ __construct()

PHPUnit\Framework\Constraint\ClassHasAttribute::__construct ( string  $attributeName)

Member Function Documentation

◆ attributeName()

PHPUnit\Framework\Constraint\ClassHasAttribute::attributeName ( )
protected

◆ failureDescription()

PHPUnit\Framework\Constraint\ClassHasAttribute::failureDescription (   $other)
protected

Returns the description of the failure

The beginning of failure messages is "Failed asserting that" in most cases. This method should return the second part of that sentence.

Parameters
mixed$otherevaluated value or object

Reimplemented from PHPUnit\Framework\Constraint\Constraint.

◆ matches()

PHPUnit\Framework\Constraint\ClassHasAttribute::matches (   $other)
protected

Evaluates the constraint for parameter $other. Returns true if the constraint is met, false otherwise.

Parameters
mixed$othervalue or object to evaluate

Reimplemented from PHPUnit\Framework\Constraint\Constraint.

Reimplemented in PHPUnit\Framework\Constraint\ClassHasStaticAttribute, and PHPUnit\Framework\Constraint\ObjectHasAttribute.

◆ toString()

PHPUnit\Framework\Constraint\ClassHasAttribute::toString ( )

Returns a string representation of the constraint.

Implements PHPUnit\Framework\SelfDescribing.

Reimplemented in PHPUnit\Framework\Constraint\ClassHasStaticAttribute.


The documentation for this class was generated from the following file: