\PHPUnit_Framework_Constraint_StringContains

Constraint that asserts that the string it is evaluated for contains a given string.

Uses strpos() to find the position of the string in the input, if not found
the evaluation fails.

The sub-string is passed in the constructor.

Synopsis

class PHPUnit_Framework_Constraint_StringContains extends PHPUnit_Framework_Constraint {
  • // Inherited members from PHPUnit_Framework_Constraint
  • protected $exporter;
}

Hierarchy

Violations

Checkstyle

Line Column Severity Message
65 1 error Each class must be in a namespace of at least one level (a top-level vendor name)
65 1 error Class name "PHPUnit_Framework_Constraint_StringContains" is not in camel caps format

Members

protected

  • $exporter
  • $ignoreCase — boolean
  • $string — string

Methods

protected

  • 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