\PHPUnit_Framework_Constraint_ObjectHasAttribute

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

The attribute name is passed in the constructor.

Synopsis

class PHPUnit_Framework_Constraint_ObjectHasAttribute extends PHPUnit_Framework_Constraint_ClassHasAttribute {
  • // Inherited members from PHPUnit_Framework_Constraint_ClassHasAttribute
  • protected string $attributeName;
  • // Inherited members from PHPUnit_Framework_Constraint
  • protected $exporter;
  • // methods
  • protected bool matches()
}

Hierarchy

Members

protected

  • $attributeName — string
  • $exporter

Methods

protected

  • matches() — Evaluates the constraint for parameter $other. Returns true if the constraint is met, false otherwise.

Inherited from PHPUnit_Framework_Constraint_ClassHasAttribute

protected

  • failureDescription() — Returns the description of the failure
  • matches() — Evaluates the constraint for parameter $other. Returns true if the constraint is met, false otherwise.

public

  • toString() — Returns a string representation of the constraint.

Inherited from PHPUnit_Framework_Constraint

protected

  • additionalFailureDescription() — Return additional failure description where needed
  • fail() — Throws an exception for the given compared value and test description
  • failureDescription() — Returns the description of the failure
  • matches() — Evaluates the constraint for parameter $other. Returns true if the constraint is met, false otherwise.

public

  • count() — Counts the number of constraint elements.
  • evaluate() — Evaluates the constraint for parameter $other

History