public function PHPUnit_Framework_Comparator_Scalar::accepts

Returns whether the comparator can compare two values.

@since Method available since Release 3.6.0

Parameters

mixed $expected The first value to compare:

mixed $actual The second value to compare:

Return value

boolean

Overrides PHPUnit_Framework_Comparator::accepts

1 method overrides PHPUnit_Framework_Comparator_Scalar::accepts()
PHPUnit_Framework_Comparator_Numeric::accepts in drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Numeric.php
Returns whether the comparator can compare two values.

File

drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Scalar.php, line 67

Class

PHPUnit_Framework_Comparator_Scalar
Compares scalar or NULL values for equality.

Code

public function accepts($expected, $actual) {
  return (is_scalar($expected) xor NULL === $expected) && (is_scalar($actual) xor NULL === $actual) || is_string($expected) && is_object($actual) && method_exists($actual, '__toString') || is_object($expected) && method_exists($expected, '__toString') && is_string($actual);
}