You are here

public function PHPUnit_Framework_Constraint_IsEqual::toString in Zircon Profile 8

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

Returns a string representation of the constraint.

Return value

string

Overrides PHPUnit_Framework_SelfDescribing::toString

File

vendor/phpunit/phpunit/src/Framework/Constraint/IsEqual.php, line 148

Class

PHPUnit_Framework_Constraint_IsEqual
Constraint that checks if one value is equal to another.

Code

public function toString() {
  $delta = '';
  if (is_string($this->value)) {
    if (strpos($this->value, "\n") !== false) {
      return 'is equal to <text>';
    }
    else {
      return sprintf('is equal to <string:%s>', $this->value);
    }
  }
  else {
    if ($this->delta != 0) {
      $delta = sprintf(' with delta <%F>', $this->delta);
    }
    return sprintf('is equal to %s%s', $this->exporter
      ->export($this->value), $delta);
  }
}