| @@ 18-42 (lines=25) @@ | ||
| 15 | * |
|
| 16 | * @package OldTown\Workflow\ZF2\Dispatch\PhpUnit\Test |
|
| 17 | */ |
|
| 18 | class IntegrationTest extends AbstractHttpControllerTestCase |
|
| 19 | { |
|
| 20 | /** |
|
| 21 | * |
|
| 22 | * @return void |
|
| 23 | */ |
|
| 24 | public function testDispatch() |
|
| 25 | { |
|
| 26 | /** @noinspection PhpIncludeInspection */ |
|
| 27 | $this->setApplicationConfig( |
|
| 28 | include TestPaths::getPathToIntegrationTest() |
|
| 29 | ); |
|
| 30 | ||
| 31 | ||
| 32 | $this->getApplication()->getEventManager()->attach(MvcEvent::EVENT_DISPATCH_ERROR, function (MvcEvent $e) { |
|
| 33 | $exception = $e->getParam('exception', null); |
|
| 34 | if ($exception) { |
|
| 35 | throw $exception; |
|
| 36 | } |
|
| 37 | }); |
|
| 38 | ||
| 39 | ||
| 40 | $this->dispatch('test'); |
|
| 41 | } |
|
| 42 | } |
|
| 43 | ||
| @@ 18-40 (lines=23) @@ | ||
| 15 | * |
|
| 16 | * @package OldTown\Workflow\ZF2\Dispatch\PhpUnit\Test |
|
| 17 | */ |
|
| 18 | class ModuleTest extends AbstractHttpControllerTestCase |
|
| 19 | { |
|
| 20 | /** |
|
| 21 | * |
|
| 22 | * @return void |
|
| 23 | */ |
|
| 24 | public function testLoadModule() |
|
| 25 | { |
|
| 26 | /** @noinspection PhpIncludeInspection */ |
|
| 27 | $this->setApplicationConfig( |
|
| 28 | include TestPaths::getPathToIntegrationTest() |
|
| 29 | ); |
|
| 30 | ||
| 31 | $this->getApplication()->getEventManager()->attach(MvcEvent::EVENT_DISPATCH_ERROR, function (MvcEvent $e) { |
|
| 32 | $exception = $e->getParam('exception', null); |
|
| 33 | if ($exception) { |
|
| 34 | throw $exception; |
|
| 35 | } |
|
| 36 | }); |
|
| 37 | ||
| 38 | $this->assertModulesLoaded(['OldTown\Workflow\ZF2\Dispatch']); |
|
| 39 | } |
|
| 40 | } |
|
| 41 | ||