| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | public function test_from() |
||
| 17 | { |
||
| 18 | /** @var Mock|AbstractStrategy $strategy */ |
||
| 19 | $strategy = \Mockery::mock(AbstractStrategy::class)->makePartial(); |
||
| 20 | $strategy->shouldReceive('fromRepository')->andReturn('resource'); |
||
| 21 | $strategy->shouldReceive('toModel')->andReturn('model'); |
||
| 22 | $strategy->shouldReceive('toController')->andReturn('controller'); |
||
| 23 | |||
| 24 | $name = NameFactory::from('books', 'repository', $strategy); |
||
|
|
|||
| 25 | |||
| 26 | self::assertInstanceOf(Name::class, $name); |
||
| 27 | |||
| 28 | self::assertSame('resource', $name->resource()); |
||
| 29 | self::assertSame('model', $name->model()); |
||
| 30 | self::assertSame('controller', $name->controller()); |
||
| 31 | } |
||
| 33 |