You are here

public function PHPUnit_Framework_Constraint_Not::toString in Zircon Profile 8

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

Returns a string representation of the constraint.

Return value

string

Overrides PHPUnit_Framework_SelfDescribing::toString

File

vendor/phpunit/phpunit/src/Framework/Constraint/Not.php, line 130

Class

PHPUnit_Framework_Constraint_Not
Logical NOT.

Code

public function toString() {
  switch (get_class($this->constraint)) {
    case 'PHPUnit_Framework_Constraint_And':
    case 'PHPUnit_Framework_Constraint_Not':
    case 'PHPUnit_Framework_Constraint_Or':
      return 'not( ' . $this->constraint
        ->toString() . ' )';
    default:
      return self::negate($this->constraint
        ->toString());
  }
}