Code Duplication    Length = 26-28 lines in 2 locations

test/phpunit/tests/EntryNameResolverChainFunctionalTest.php 2 locations

@@ 33-58 (lines=26) @@
30
     * @throws \Interop\Container\Exception\NotFoundException
31
     * @throws \Interop\Container\Exception\ContainerException
32
     */
33
    public function testInvalidEntryNameResolverChainConfig()
34
    {
35
        /** @noinspection PhpIncludeInspection */
36
        $this->setApplicationConfig(
37
            include TestPaths::getPathToDefaultAppConfig()
38
        );
39
40
        /** @var EntryNameResolverManagerInterface $entryNameResolverManager */
41
        $entryNameResolverManager = $this->getApplicationServiceLocator()->get(EntryNameResolverManagerInterface::class);
42
43
        $e = null;
44
        try {
45
            $entryNameResolverManager->get(EntryNameResolverChain::class, [
46
                'resolvers' => [
47
                    'invalidEntryNameResolver'
48
                ]
49
            ]);
50
        } catch (\Exception $ex) {
51
            $e = $ex;
52
        }
53
54
        static::assertInstanceOf(\Exception::class, $e);
55
        $prevException = $e->getPrevious();
56
        static::assertInstanceOf(RuntimeException::class, $prevException);
57
        static::assertEquals('Entry name resolver config is not array', $prevException->getMessage());
58
    }
59
60
    /**
61
     * Проверка получения резолвера с конфигом, в котором в описание вложенного резолвера не указано имя.
@@ 69-96 (lines=28) @@
66
     * @throws \Interop\Container\Exception\NotFoundException
67
     * @throws \Interop\Container\Exception\ContainerException
68
     */
69
    public function testNestedResolverInvalidName()
70
    {
71
        /** @noinspection PhpIncludeInspection */
72
        $this->setApplicationConfig(
73
            include TestPaths::getPathToDefaultAppConfig()
74
        );
75
76
        /** @var EntryNameResolverManagerInterface $entryNameResolverManager */
77
        $entryNameResolverManager = $this->getApplicationServiceLocator()->get(EntryNameResolverManagerInterface::class);
78
79
        $e = null;
80
        try {
81
            $entryNameResolverManager->get(EntryNameResolverChain::class, [
82
                'resolvers' => [
83
                    [
84
85
                    ]
86
                ]
87
            ]);
88
        } catch (\Exception $ex) {
89
            $e = $ex;
90
        }
91
92
        static::assertInstanceOf(\Exception::class, $e);
93
        $prevException = $e->getPrevious();
94
        static::assertInstanceOf(RuntimeException::class, $prevException);
95
        static::assertEquals('Resolver entry name not found', $prevException->getMessage());
96
    }
97
98
    /**
99
     * Проверка получения резолвера с конфигом, в котором в опции вложенного резолвера описаны не строкой