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
 * Is the value equal to another value, as tested by the use of the "=="
12
 * comparison operator?
13
 */
14
class IsEqual extends BaseMatcher
15
{
16
 
17
    private $_item;
18
 
19
    public function __construct($item)
20
    {
21
        $this->_item = $item;
22
    }
23
 
24
    public function matches($arg)
25
    {
26
        return (($arg == $this->_item) && ($this->_item == $arg));
27
    }
28
 
29
    public function describeTo(Description $description)
30
    {
31
        $description->appendValue($this->_item);
32
    }
33
 
34
    /**
35
     * Is the value equal to another value, as tested by the use of the "=="
36
     * comparison operator?
37
     *
38
     * @factory
39
     */
40
    public static function equalTo($item)
41
    {
42
        return new self($item);
43
    }
44
}