Subversion Repositories web.creative

Rev

Details | Last modification | View Log

Rev Author Line No. Line
1 mjordaan 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 true.
13
 */
14
class PHPUnit_Framework_Constraint_IsTrue extends PHPUnit_Framework_Constraint
15
{
16
    /**
17
     * Evaluates the constraint for parameter $other. Returns true if the
18
     * constraint is met, false otherwise.
19
     *
20
     * @param mixed $other Value or object to evaluate.
21
     *
22
     * @return bool
23
     */
24
    protected function matches($other)
25
    {
26
        return $other === true;
27
    }
28
 
29
    /**
30
     * Returns a string representation of the constraint.
31
     *
32
     * @return string
33
     */
34
    public function toString()
35
    {
36
        return 'is true';
37
    }
38
}