Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
namespace Hamcrest\Core;
3
 
4
/*
5
 Copyright (c) 2009 hamcrest.org
6
 */
7
use Hamcrest\BaseMatcher;
8
use Hamcrest\Description;
9
 
10
/**
11
 * A matcher that always returns <code>true</code>.
12
 */
13
class IsAnything extends BaseMatcher
14
{
15
 
16
    private $_message;
17
 
18
    public function __construct($message = 'ANYTHING')
19
    {
20
        $this->_message = $message;
21
    }
22
 
23
    public function matches($item)
24
    {
25
        return true;
26
    }
27
 
28
    public function describeTo(Description $description)
29
    {
30
        $description->appendText($this->_message);
31
    }
32
 
33
    /**
34
     * This matcher always evaluates to true.
35
     *
36
     * @param string $description A meaningful string used when describing itself.
37
     *
38
     * @return \Hamcrest\Core\IsAnything
39
     * @factory
40
     */
41
    public static function anything($description = 'ANYTHING')
42
    {
43
        return new self($description);
44
    }
45
}