| Total Complexity | 3 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class ProviderTest extends TestCase |
||
| 13 | { |
||
| 14 | /** @test */ |
||
| 15 | public function it_respects_is_contract(): void |
||
| 16 | { |
||
| 17 | $this->assertInstanceOf(ProviderContract::class, new Provider()); |
||
| 18 | } |
||
| 19 | |||
| 20 | /** @test */ |
||
| 21 | public function it_registers_the_error_handler(): void |
||
| 22 | { |
||
| 23 | $handler = new Handler(); |
||
| 24 | |||
| 25 | $runMock = $this->createMock(RunInterface::class); |
||
| 26 | |||
| 27 | $runMock->expects($this->once()) |
||
| 28 | ->method('pushHandler') |
||
| 29 | ->with($handler) |
||
| 30 | ->willReturn($runMock); |
||
| 31 | |||
| 32 | $runMock->expects($this->once()) |
||
| 33 | ->method('register'); |
||
| 34 | |||
| 35 | (new Provider($runMock, $handler))->register(); |
||
| 36 | } |
||
| 37 | |||
| 38 | /** @test */ |
||
| 39 | public function it_gets_the_handler(): void |
||
| 40 | { |
||
| 41 | $handler = new Handler(); |
||
| 42 | $provider = new Provider(new Run(), $handler); |
||
| 43 | |||
| 44 | $this->assertEquals($provider->getHandler(), $handler); |
||
| 45 | } |
||
| 47 |