Total Complexity | 4 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | class ManagerTests extends TestCase |
||
10 | { |
||
11 | /** |
||
12 | * @test |
||
13 | */ |
||
14 | public function make() |
||
15 | { |
||
16 | $manager = $this->getManager(); |
||
17 | |||
18 | $this->assertEquals($manager->driver(), 'foo_driver'); |
||
19 | $this->assertEquals($manager->driver('foo'), 'foo_driver'); |
||
20 | $this->assertEquals($manager->driver('bar'), 'bar_driver'); |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * @test |
||
25 | */ |
||
26 | public function makeWithUnexpectedDriver() |
||
27 | { |
||
28 | $manager = $this->getManager(); |
||
29 | |||
30 | $this->expectException(InvalidArgumentException::class); |
||
31 | |||
32 | $manager->driver('unexpected'); |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * @return Anonymous |
||
37 | */ |
||
38 | protected function getManager() |
||
39 | { |
||
40 | return new class extends Manager { |
||
41 | |||
42 | public function createFooDriver() |
||
46 | |||
47 | public function createBarDriver() |
||
51 | |||
52 | public function getDefaultDriver() |
||
56 | }; |
||
57 | } |
||
58 | } |
||
59 |