3
* This file is part of PHPUnit.
5
* (c) Sebastian Bergmann <sebastian@phpunit.de>
7
* For the full copyright and license information, please view the LICENSE
8
* file that was distributed with this source code.
12
* Constraint that accepts any input value.
15
* @subpackage Framework_Constraint
16
* @author Sebastian Bergmann <sebastian@phpunit.de>
17
* @author Bernhard Schussek <bschussek@2bepublished.at>
18
* @copyright Sebastian Bergmann <sebastian@phpunit.de>
19
* @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
20
* @link http://www.phpunit.de/
21
* @since Class available since Release 3.0.0
23
class PHPUnit_Framework_Constraint_IsAnything extends PHPUnit_Framework_Constraint
26
* Evaluates the constraint for parameter $other
28
* If $returnResult is set to false (the default), an exception is thrown
29
* in case of a failure. null is returned otherwise.
31
* If $returnResult is true, the result of the evaluation is returned as
32
* a boolean value instead: true in case of success, false in case of a
35
* @param mixed $other Value or object to evaluate.
36
* @param string $description Additional information about the test
37
* @param bool $returnResult Whether to return a result or throw an exception
39
* @throws PHPUnit_Framework_ExpectationFailedException
41
public function evaluate($other, $description = '', $returnResult = false)
43
return $returnResult ? true : null;
47
* Returns a string representation of the constraint.
51
public function toString()
57
* Counts the number of constraint elements.
60
* @since Method available since Release 3.5.0
62
public function count()