Code Duplication    Length = 19-20 lines in 2 locations

src/TreeHouse/IoBundle/Test/Import/FeedType/FeedTypeTestCase.php 1 location

@@ 55-73 (lines=19) @@
52
    /**
53
     * @return string[]
54
     */
55
    public function getFixtureNames()
56
    {
57
        $refl = new \ReflectionClass(get_class($this));
58
        $dir = sprintf('%s/fixtures/%s', dirname($refl->getFilename()), $this->getFeedType());
59
60
        $files = Finder::create()->files()->name('*.xml')->in($dir);
61
62
        $fixtures = [];
63
        /** @var \SplFileInfo $file */
64
        foreach ($files as $file) {
65
            $fixtures[] = [$file->getBasename('.xml')];
66
        }
67
68
        if (empty($fixtures)) {
69
            $this->markTestSkipped(sprintf('No fixtures for %s created', $this->getFeedType()));
70
        }
71
72
        return $fixtures;
73
    }
74
75
    /**
76
     * @dataProvider getFixtureNames

src/TreeHouse/IoBundle/Test/Scrape/Parser/ParserTypeTestCase.php 1 location

@@ 57-76 (lines=20) @@
54
    /**
55
     * @return string[]
56
     */
57
    public function getFixtureNames()
58
    {
59
        $fixtures = [];
60
61
        $refl = new \ReflectionClass(get_class($this));
62
        $dir = sprintf('%s/fixtures/%s', dirname($refl->getFilename()), $this->getParserType());
63
64
        $files = Finder::create()->files()->name('*.html')->in($dir);
65
66
        /** @var \SplFileInfo $file */
67
        foreach ($files as $file) {
68
            $fixtures[] = [$file->getBasename('.html')];
69
        }
70
71
        if (empty($fixtures)) {
72
            $this->markTestSkipped(sprintf('No fixtures for %s created', $this->getParserType()));
73
        }
74
75
        return $fixtures;
76
    }
77
78
    /**
79
     * @dataProvider getFixtureNames