| 1 | <?php |
||
| 7 | class AdminUserHelperFactoryTest extends \PHPUnit_Framework_TestCase |
||
| 8 | { |
||
| 9 | public function testInvokingAdminUserHelperShouldReturnAdminUserService() |
||
| 10 | { |
||
| 11 | $session = new \Zend\Session\SessionManager(); |
||
| 12 | $adminUserService = $this->getMockBuilder(\Admin\Service\AdminUserService::class) |
||
| 13 | ->disableOriginalConstructor() |
||
| 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($session)); |
||
| 21 | $container->expects(static::at(1)) |
||
| 22 | ->method('get') |
||
| 23 | ->will(static::returnValue($adminUserService)); |
||
| 24 | $adminUserHelperFactory = new \Admin\Factory\View\Helper\AdminUserHelperFactory(); |
||
| 25 | static::assertInstanceOf(\Admin\View\Helper\AdminUserHelper::class, $adminUserHelperFactory($container, 'test')); |
||
| 26 | } |
||
| 27 | } |
||
| 28 |