1 | <?php |
||
13 | class RegistryEntryTest extends \PHPUnit_Framework_TestCase |
||
14 | { |
||
15 | public function testGetProvidersEmptyIfNoProviders() |
||
16 | { |
||
17 | $provider = $this->getMock(DataProvider::class); |
||
18 | |||
19 | $testedInstance = new RegistryEntry( |
||
20 | $provider, |
||
21 | 'my_index', |
||
22 | 'my_type' |
||
23 | ); |
||
24 | |||
25 | $this->assertEquals( |
||
26 | $provider, |
||
27 | $testedInstance->getProvider() |
||
28 | ); |
||
29 | |||
30 | $this->assertEquals( |
||
31 | 'my_index', |
||
32 | $testedInstance->getIndex() |
||
33 | ); |
||
34 | $this->assertEquals( |
||
35 | 'my_type', |
||
36 | $testedInstance->getType() |
||
37 | ); |
||
38 | } |
||
39 | |||
40 | public function testMatch() |
||
41 | { |
||
42 | $testedInstance = new RegistryEntry( |
||
43 | $this->getMock(DataProvider::class), |
||
44 | 'my_index', |
||
45 | 'my_type' |
||
46 | ); |
||
47 | |||
48 | $this->assertTrue( |
||
49 | $testedInstance->match('my_index', 'my_type') |
||
50 | ); |
||
51 | |||
52 | $this->assertFalse( |
||
53 | $testedInstance->match('my_index', 'my_type_2') |
||
54 | ); |
||
55 | |||
56 | $this->assertTrue( |
||
57 | $testedInstance->match('my_index', null) |
||
58 | ); |
||
59 | |||
60 | $this->assertFalse( |
||
61 | $testedInstance->match('my_index_2', 'my_type') |
||
62 | ); |
||
63 | |||
64 | $this->assertTrue( |
||
65 | $testedInstance->match(null, null) |
||
66 | ); |
||
67 | } |
||
68 | } |
||
69 |