Abstract base class for comparators which compare values for equality.
@package PHPUnit @subpackage Framework @author Bernhard Schussek <bschussek@2bepublished.at> @copyright 2001-2013 Sebastian Bergmann <sebastian@phpunit.de> @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License @link http://www.phpunit.de/ @since Class available since Release 3.6.0
Expanded class hierarchy of PHPUnit_Framework_Comparator
abstract class PHPUnit_Framework_Comparator {
/**
* @var PHPUnit_Framework_ComparatorFactory
*/
protected $factory;
/**
* @param PHPUnit_Framework_ComparatorFactory $factory
*/
public function setFactory(PHPUnit_Framework_ComparatorFactory $factory) {
$this->factory = $factory;
}
/**
* Returns whether the comparator can compare two values.
*
* @param mixed $expected The first value to compare
* @param mixed $actual The second value to compare
* @return boolean
*/
public abstract function accepts($expected, $actual);
/**
* Asserts that two values are equal.
*
* @param mixed $expected The first value to compare
* @param mixed $actual The second value to compare
* @param float $delta The allowed numerical distance between two values to
* consider them equal
* @param bool $canonicalize If set to TRUE, arrays are sorted before
* comparison
* @param bool $ignoreCase If set to TRUE, upper- and lowercasing is
* ignored when comparing string values
* @throws PHPUnit_Framework_ComparisonFailure Thrown when the comparison
* fails. Contains information about the
* specific errors that lead to the failure.
*/
public abstract function assertEquals($expected, $actual, $delta = 0, $canonicalize = FALSE, $ignoreCase = FALSE);
}
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PHPUnit_Framework_Comparator:: |
protected | property | ||
PHPUnit_Framework_Comparator:: |
abstract public | function | Returns whether the comparator can compare two values. | 5 |
PHPUnit_Framework_Comparator:: |
abstract public | function | Asserts that two values are equal. | 5 |
PHPUnit_Framework_Comparator:: |
public | function |