~ballot/wordpress/openstack-objectstorage-bis

« back to all changes in this revision

Viewing changes to vendor/phpunit/phpunit/src/Framework/Constraint/IsAnything.php

  • Committer: Jacek Nykis
  • Date: 2015-02-11 15:35:31 UTC
  • Revision ID: jacek.nykis@canonical.com-20150211153531-hmy6zi0ov2qfkl0b
Initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/*
 
3
 * This file is part of PHPUnit.
 
4
 *
 
5
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 
6
 *
 
7
 * For the full copyright and license information, please view the LICENSE
 
8
 * file that was distributed with this source code.
 
9
 */
 
10
 
 
11
/**
 
12
 * Constraint that accepts any input value.
 
13
 *
 
14
 * @package    PHPUnit
 
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
 
22
 */
 
23
class PHPUnit_Framework_Constraint_IsAnything extends PHPUnit_Framework_Constraint
 
24
{
 
25
    /**
 
26
     * Evaluates the constraint for parameter $other
 
27
     *
 
28
     * If $returnResult is set to false (the default), an exception is thrown
 
29
     * in case of a failure. null is returned otherwise.
 
30
     *
 
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
 
33
     * failure.
 
34
     *
 
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
 
38
     * @return mixed
 
39
     * @throws PHPUnit_Framework_ExpectationFailedException
 
40
     */
 
41
    public function evaluate($other, $description = '', $returnResult = false)
 
42
    {
 
43
        return $returnResult ? true : null;
 
44
    }
 
45
 
 
46
    /**
 
47
     * Returns a string representation of the constraint.
 
48
     *
 
49
     * @return string
 
50
     */
 
51
    public function toString()
 
52
    {
 
53
        return 'is anything';
 
54
    }
 
55
 
 
56
    /**
 
57
     * Counts the number of constraint elements.
 
58
     *
 
59
     * @return integer
 
60
     * @since  Method available since Release 3.5.0
 
61
     */
 
62
    public function count()
 
63
    {
 
64
        return 0;
 
65
    }
 
66
}