Code Duplication    Length = 14-16 lines in 2 locations

test/ComposerRequireCheckerTest/FileLocator/LocateComposerPackageSourceFilesTest.php 2 locations

@@ 28-43 (lines=16) @@
25
        $this->root = vfsStream::setup();
26
    }
27
28
    public function testFromClassmap()
29
    {
30
        vfsStream::create([
31
            'composer.json' => '{"autoload": {"classmap": ["src/MyClassA.php", "MyClassB.php"]}}',
32
            'src' => [
33
                'MyClassA.php' => '<?php class MyClassA {}',
34
            ],
35
            'MyClassB.php' => '<?php class MyClassB {}',
36
        ]);
37
38
        $files = $this->files($this->root->getChild('composer.json')->url());
39
40
        $this->assertCount(2, $files);
41
        $this->assertContains($this->root->getChild('src/MyClassA.php')->url(), $files);
42
        $this->assertContains($this->root->getChild('MyClassB.php')->url(), $files);
43
    }
44
45
    public function testFromFiles()
46
    {
@@ 103-116 (lines=14) @@
100
        $this->assertContains($this->root->getChild('lib/MyNamespace/MyClassB.php')->url(), $files);
101
    }
102
103
    public function testFromPsr4WithMultipleDirectories()
104
    {
105
        vfsStream::create([
106
            'composer.json' => '{"autoload": {"psr-4": {"MyNamespace\\\\": ["src", "lib"]}}}',
107
            'src' => ['MyClassA.php' => '<?php namespace MyNamespace; class MyClassA {}'],
108
            'lib' => ['MyClassB.php' => '<?php namespace MyNamespace; class MyClassB {}'],
109
        ]);
110
111
        $files = $this->files($this->root->getChild('composer.json')->url());
112
113
        $this->assertCount(2, $files);
114
        $this->assertContains($this->root->getChild('src/MyClassA.php')->url(), $files);
115
        $this->assertContains($this->root->getChild('lib/MyClassB.php')->url(), $files);
116
    }
117
118
    /**
119
     * @return string[]