Code Duplication    Length = 18-19 lines in 2 locations

tests/Promise/ProxyCreatorTest.php 2 locations

@@ 94-111 (lines=18) @@
91
    /**
92
     * @throws \ReflectionException
93
     */
94
    public function testUseStmtsInSameNamespace()
95
    {
96
        $class = Fixtures\Entity::class;
97
        $as = "EntityProxy" . __LINE__;
98
99
        $output = $this->make($class, $as);
100
        $output = ltrim($output, "<?php");
101
102
        $schema = new Schema($class, $as);
103
        $this->assertFalse(class_exists($schema->class->getNamespacesName()));
104
105
        eval($output);
106
107
        $this->assertSame($this->fetchUseStatements($output), $this->fetchExternalDependencies($schema->class->getNamespacesName(), [
108
            PromiseResolver::class,
109
            PromiseInterface::class
110
        ]));
111
    }
112
113
    /**
114
     * @throws \ReflectionException
@@ 116-134 (lines=19) @@
113
    /**
114
     * @throws \ReflectionException
115
     */
116
    public function testUseStmtsInDifferentNamespace()
117
    {
118
        $class = Fixtures\Entity::class;
119
        $as = "\EntityProxy" . __LINE__;
120
121
        $output = $this->make($class, $as);
122
        $output = ltrim($output, "<?php");
123
124
        $schema = new Schema($class, $as);
125
        $this->assertFalse(class_exists($schema->class->getNamespacesName()));
126
127
        eval($output);
128
129
        $this->assertSame($this->fetchUseStatements($output), $this->fetchExternalDependencies($schema->class->getNamespacesName(), [
130
            PromiseResolver::class,
131
            PromiseInterface::class,
132
            $class
133
        ]));
134
    }
135
136
    private function fetchUseStatements(string $code): array
137
    {