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;
3
 
4
use PHPUnit\Framework\TestCase;
5
 
6
class SampleInvokeMatcher extends BaseMatcherTest
7
{
8
    private $matchAgainst;
9
 
10
    public function __construct($matchAgainst)
11
    {
12
        $this->matchAgainst = $matchAgainst;
13
    }
14
 
15
    public function matches($item)
16
    {
17
        return $item == $this->matchAgainst;
18
    }
19
 
20
}
21
 
22
class InvokedMatcherTest extends TestCase
23
{
24
    public function testInvokedMatchersCallMatches()
25
    {
26
        $sampleMatcher = new SampleInvokeMatcher('foo');
27
 
28
        $this->assertTrue($sampleMatcher('foo'));
29
        $this->assertFalse($sampleMatcher('bar'));
30
    }
31
}