You are here

public function PHPUnit_Framework_Constraint_TraversableContains::toString in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/src/Framework/Constraint/TraversableContains.php \PHPUnit_Framework_Constraint_TraversableContains::toString()

Returns a string representation of the constraint.

Return value

string

Overrides PHPUnit_Framework_SelfDescribing::toString

1 call to PHPUnit_Framework_Constraint_TraversableContains::toString()
PHPUnit_Framework_Constraint_TraversableContains::failureDescription in vendor/phpunit/phpunit/src/Framework/Constraint/TraversableContains.php
Returns the description of the failure

File

vendor/phpunit/phpunit/src/Framework/Constraint/TraversableContains.php, line 98

Class

PHPUnit_Framework_Constraint_TraversableContains
Constraint that asserts that the Traversable it is applied to contains a given value.

Code

public function toString() {
  if (is_string($this->value) && strpos($this->value, "\n") !== false) {
    return 'contains "' . $this->value . '"';
  }
  else {
    return 'contains ' . $this->exporter
      ->export($this->value);
  }
}