\PHPUnit_Framework_Constraint_ArraySubset

Constraint that asserts that the array it is evaluated for has a specified subset.

Uses array_replace_recursive() to check if a key value subset is part of the
subject array.

Synopsis

class PHPUnit_Framework_Constraint_ArraySubset extends PHPUnit_Framework_Constraint {
  • // members
  • protected array|ArrayAccess $subset;
  • protected boolean $strict;
  • // Inherited members from PHPUnit_Framework_Constraint
  • protected $exporter;
}

Hierarchy

Members

protected

Methods

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

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