| @@ 113-128 (lines=16) @@ | ||
| 110 | * @throws \Zend\ServiceManager\Exception\ServiceNotFoundException |
|
| 111 | * @throws \Nnx\EntryNameResolver\Exception\InvalidContextException |
|
| 112 | */ |
|
| 113 | public function testResolveEntryNameByInvalidContext() |
|
| 114 | { |
|
| 115 | /** @noinspection PhpIncludeInspection */ |
|
| 116 | $this->setApplicationConfig( |
|
| 117 | include TestPaths::getPathToContextResolverAppConfig() |
|
| 118 | ); |
|
| 119 | ||
| 120 | ||
| 121 | /** @var EntryNameResolverManager $entryNameResolverManager */ |
|
| 122 | $entryNameResolverManager = $this->getApplicationServiceLocator()->get(EntryNameResolverManagerInterface::class); |
|
| 123 | ||
| 124 | /** @var ResolverByClassName $resolverByClassName */ |
|
| 125 | $resolverByClassName = $entryNameResolverManager->get(ResolverByClassName::class); |
|
| 126 | ||
| 127 | $resolverByClassName->resolveEntryNameByContext(\stdClass::class, false); |
|
| 128 | } |
|
| 129 | ||
| 130 | ||
| 131 | /** |
|
| @@ 107-122 (lines=16) @@ | ||
| 104 | * @throws \Zend\Stdlib\Exception\LogicException |
|
| 105 | * @throws \Zend\ServiceManager\Exception\ServiceNotFoundException |
|
| 106 | */ |
|
| 107 | public function testResolveEntryNameByInvalidContext() |
|
| 108 | { |
|
| 109 | /** @noinspection PhpIncludeInspection */ |
|
| 110 | $this->setApplicationConfig( |
|
| 111 | include TestPaths::getPathToContextResolverAppConfig() |
|
| 112 | ); |
|
| 113 | ||
| 114 | ||
| 115 | /** @var EntryNameResolverManager $entryNameResolverManager */ |
|
| 116 | $entryNameResolverManager = $this->getApplicationServiceLocator()->get(EntryNameResolverManagerInterface::class); |
|
| 117 | ||
| 118 | /** @var ResolverByModuleContextMap $resolverByModuleContextMap */ |
|
| 119 | $resolverByModuleContextMap = $entryNameResolverManager->get(ResolverByModuleContextMap::class); |
|
| 120 | ||
| 121 | $resolverByModuleContextMap->resolveEntryNameByContext('test', false); |
|
| 122 | } |
|
| 123 | ||
| 124 | /** |
|
| 125 | * Проверка ситуации когда, |
|
| @@ 43-57 (lines=15) @@ | ||
| 40 | * @throws \Zend\Stdlib\Exception\LogicException |
|
| 41 | * @throws \Zend\ServiceManager\Exception\ServiceNotFoundException |
|
| 42 | */ |
|
| 43 | public function testEntryNameResolverMirror($entryName) |
|
| 44 | { |
|
| 45 | /** @noinspection PhpIncludeInspection */ |
|
| 46 | $this->setApplicationConfig( |
|
| 47 | include TestPaths::getPathToContextResolverAppConfig() |
|
| 48 | ); |
|
| 49 | ||
| 50 | /** @var EntryNameResolverManagerInterface $entryNameResolverManager */ |
|
| 51 | $entryNameResolverManager = $this->getApplicationServiceLocator()->get(EntryNameResolverManagerInterface::class); |
|
| 52 | ||
| 53 | /** @var EntryNameResolverMirror $entryNameResolverMirror */ |
|
| 54 | $entryNameResolverMirror = $entryNameResolverManager->get(EntryNameResolverMirror::class); |
|
| 55 | ||
| 56 | static::assertEquals($entryName, $entryNameResolverMirror->resolveEntryNameByContext($entryName)); |
|
| 57 | } |
|
| 58 | } |
|
| 59 | ||