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\Collection;
3
 
4
use Hamcrest\AbstractMatcherTest;
5
 
6
class IsEmptyTraversableTest extends AbstractMatcherTest
7
{
8
 
9
    protected function createMatcher()
10
    {
11
        return IsEmptyTraversable::emptyTraversable();
12
    }
13
 
14
    public function testEmptyMatcherMatchesWhenEmpty()
15
    {
16
        $this->assertMatches(
17
            emptyTraversable(),
18
            new \ArrayObject(array()),
19
            'an empty traversable'
20
        );
21
    }
22
 
23
    public function testEmptyMatcherDoesNotMatchWhenNotEmpty()
24
    {
25
        $this->assertDoesNotMatch(
26
            emptyTraversable(),
27
            new \ArrayObject(array(1, 2, 3)),
28
            'a non-empty traversable'
29
        );
30
    }
31
 
32
    public function testEmptyMatcherDoesNotMatchNull()
33
    {
34
        $this->assertDoesNotMatch(
35
            emptyTraversable(),
36
            null,
37
            'should not match null'
38
        );
39
    }
40
 
41
    public function testEmptyMatcherHasAReadableDescription()
42
    {
43
        $this->assertDescription('an empty traversable', emptyTraversable());
44
    }
45
 
46
    public function testNonEmptyDoesNotMatchNull()
47
    {
48
        $this->assertDoesNotMatch(
49
            nonEmptyTraversable(),
50
            null,
51
            'should not match null'
52
        );
53
    }
54
 
55
    public function testNonEmptyDoesNotMatchWhenEmpty()
56
    {
57
        $this->assertDoesNotMatch(
58
            nonEmptyTraversable(),
59
            new \ArrayObject(array()),
60
            'an empty traversable'
61
        );
62
    }
63
 
64
    public function testNonEmptyMatchesWhenNotEmpty()
65
    {
66
        $this->assertMatches(
67
            nonEmptyTraversable(),
68
            new \ArrayObject(array(1, 2, 3)),
69
            'a non-empty traversable'
70
        );
71
    }
72
 
73
    public function testNonEmptyNonEmptyMatcherHasAReadableDescription()
74
    {
75
        $this->assertDescription('a non-empty traversable', nonEmptyTraversable());
76
    }
77
}