| 1 | <?php |
||
| 7 | class CategoryServiceFactoryTest extends \PHPUnit_Framework_TestCase |
||
| 8 | { |
||
| 9 | public function testInvokingFactoryShouldReturnExpectedInstance() |
||
| 10 | { |
||
| 11 | $categoryFilter = $this->getMockBuilder(\Category\Filter\CategoryFilter::class) |
||
| 12 | ->getMockForAbstractClass(); |
||
| 13 | $categoryMapper = $this->getMockBuilder(\Category\Mapper\CategoryMapper::class) |
||
| 14 | ->getMockForAbstractClass(); |
||
| 15 | $container = $this->getMockBuilder(\Interop\Container\ContainerInterface::class) |
||
| 16 | ->setMethods(['get']) |
||
| 17 | ->getMockForAbstractClass(); |
||
| 18 | $container->expects(static::at(0)) |
||
| 19 | ->method('get') |
||
| 20 | ->will(static::returnValue(['upload' => ['public_path' => 'test', 'non_public_path' => 'test']])); |
||
| 21 | $container->expects(static::at(1)) |
||
| 22 | ->method('get') |
||
| 23 | ->will(static::returnValue($categoryMapper)); |
||
| 24 | $container->expects(static::at(2)) |
||
| 25 | ->method('get') |
||
| 26 | ->will(static::returnValue($categoryFilter)); |
||
| 27 | $factory = new \Category\Factory\Service\CategoryServiceFactory(); |
||
| 28 | static::assertInstanceOf(\Category\Service\CategoryService::class, $factory($container)); |
||
| 29 | } |
||
| 30 | } |
||
| 31 |