Code Duplication    Length = 17-18 lines in 2 locations

tests/Promise/ProxyPrinterTest.php 2 locations

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