Code Duplication    Length = 17-18 lines in 2 locations

tests/Promise/ProxyCreatorTest.php 2 locations

@@ 73-89 (lines=17) @@
70
    /**
71
     * @throws \ReflectionException
72
     */
73
    public function testDifferentNamespace()
74
    {
75
        $class = Fixtures\Entity::class;
76
        $as = "\EntityProxy" . __LINE__;
77
78
        $output = $this->make($class, $as);
79
        $output = ltrim($output, "<?php");
80
81
        $schema = new Schema($class, $as);
82
        $this->assertFalse(class_exists($schema->class->getNamespacesName()));
83
84
        eval($output);
85
86
        $proxyReflection = new \ReflectionClass($schema->class->getNamespacesName());
87
        $this->assertSame('', (string)$proxyReflection->getNamespaceName());
88
        $this->assertStringNotContainsString('namespace ', $output);
89
    }
90
91
    /**
92
     * @throws \ReflectionException
@@ 288-305 (lines=18) @@
285
        $this->assertStringContainsString('parent::__construct();', $output);
286
    }
287
288
    public function testPromiseMethods()
289
    {
290
        $class = Fixtures\Entity::class;
291
        $as = "EntityProxy" . __LINE__;
292
293
        $output = $this->make($class, $as);
294
        $output = ltrim($output, "<?php");
295
296
        $schema = new Schema($class, $as);
297
        $this->assertFalse(class_exists($schema->class->getNamespacesName()));
298
299
        eval($output);
300
301
        $i = new \ReflectionClass(PromiseInterface::class);
302
        foreach ($i->getMethods() as $method) {
303
            $this->assertStringContainsString("public function {$method->getName()}()", $output);
304
        }
305
    }
306
307
    public function testProxiedMethods()
308
    {