Code Duplication    Length = 13-15 lines in 3 locations

test/ComposerRequireCheckerTest/FileLocator/LocateComposerPackageSourceFilesTest.php 3 locations

@@ 58-72 (lines=15) @@
55
        $this->assertContains($this->root->getChild('foo.php')->url(), $files);
56
    }
57
58
    public function testFromPsr0()
59
    {
60
        vfsStream::create([
61
            'composer.json' => '{"autoload": {"psr-0": ["src"]}}',
62
            'src' => [
63
                'MyNamespace' => [
64
                    'MyClass.php' => '<?php namespace MyNamespace; class MyClass {}',
65
                ],
66
            ],
67
        ]);
68
69
        $files = $this->files($this->root->getChild('composer.json')->url());
70
71
        $this->assertCount(1, $files);
72
    }
73
74
    public function testFromPsr4()
75
    {
@@ 74-86 (lines=13) @@
71
        $this->assertCount(1, $files);
72
    }
73
74
    public function testFromPsr4()
75
    {
76
        vfsStream::create([
77
            'composer.json' => '{"autoload": {"psr-4": {"MyNamespace\\\\": "src"}}}',
78
            'src' => [
79
                'MyClass.php' => '<?php namespace MyNamespace; class MyClass {}',
80
            ],
81
        ]);
82
83
        $files = $this->files($this->root->getChild('composer.json')->url());
84
85
        $this->assertCount(1, $files);
86
    }
87
88
    public function testFromPsr0WithMultipleDirectories()
89
    {
@@ 148-161 (lines=14) @@
145
        $this->assertContains($this->root->getChild('src/MyNamespace/MyClassA.php')->url(), $files);
146
    }
147
148
    public function testFromPsr4WithExcludeFromClassmap()
149
    {
150
        vfsStream::create([
151
            'composer.json' => '{"autoload": {"psr-4": {"MyNamespace\\\\": "./"}, "exclude-from-classmap": ["/tests/"]}}',
152
            'MyClass.php' => '<?php namespace MyNamespace; class MyClass {}',
153
            'tests' => [
154
                'MyClassTest.php' => '<?php namespace MyNamespace; class MyClassTest {}',
155
            ]
156
        ]);
157
158
        $files = $this->files($this->root->getChild('composer.json')->url());
159
160
        $this->assertCount(1, $files);
161
    }
162
163
    /**
164
     * @return string[]