| Conditions | 1 |
| Paths | 1 |
| Total Lines | 31 |
| Code Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function testFactoryProcessesWithoutErrors() |
||
| 16 | { |
||
| 17 | $authService = $this->getMock('\Zend\Authentication\AuthenticationServiceInterface'); |
||
| 18 | $authService |
||
| 19 | ->expects($this->once()) |
||
| 20 | ->method('getIdentity') |
||
| 21 | ->will($this->returnValue($this->getMock('ZfcUser\Entity\UserInterface'))); |
||
| 22 | |||
| 23 | $services = [ |
||
| 24 | 'JhFlexiTime\ObjectManager' => $this->getMock('Doctrine\Common\Persistence\ObjectManager'), |
||
| 25 | 'zfcuser_auth_service' => $authService, |
||
| 26 | ]; |
||
| 27 | |||
| 28 | $serviceLocator = $this->getMock('Zend\ServiceManager\ServiceLocatorInterface'); |
||
| 29 | $serviceLocator |
||
| 30 | ->expects($this->any()) |
||
| 31 | ->method('get') |
||
| 32 | ->will( |
||
| 33 | $this->returnCallback( |
||
| 34 | function ($serviceName) use ($services) { |
||
| 35 | return $services[$serviceName]; |
||
| 36 | } |
||
| 37 | ) |
||
| 38 | ); |
||
| 39 | |||
| 40 | $formElementManager = new FormElementManager(); |
||
| 41 | $formElementManager->setServiceLocator($serviceLocator); |
||
| 42 | |||
| 43 | $factory = new BookingFormFactory(); |
||
| 44 | $this->assertInstanceOf('JhFlexiTime\Form\BookingForm', $factory->createService($formElementManager)); |
||
| 45 | } |
||
| 46 | } |
||
| 47 |