diff --git a/tests/Composer/Test/Autoload/ClassMapGeneratorTest.php b/tests/Composer/Test/Autoload/ClassMapGeneratorTest.php index d0dcd2d6b..eff1b86a6 100644 --- a/tests/Composer/Test/Autoload/ClassMapGeneratorTest.php +++ b/tests/Composer/Test/Autoload/ClassMapGeneratorTest.php @@ -79,9 +79,7 @@ class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase public function testCreateMapFinderSupport() { - if (!class_exists('Symfony\\Component\\Finder\\Finder')) { - $this->markTestSkipped('Finder component is not available'); - } + $this->checkIfFinderIsAvailable(); $finder = new Finder(); $finder->files()->in(__DIR__ . '/Fixtures/beta/NamespaceCollision'); @@ -110,9 +108,7 @@ class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase */ public function testAmbiguousReference() { - if (!class_exists('Symfony\\Component\\Finder\\Finder')) { - $this->markTestSkipped('Finder component is not available'); - } + $this->checkIfFinderIsAvailable(); $finder = new Finder(); $finder->files()->in(__DIR__ . '/Fixtures/Ambiguous'); @@ -139,4 +135,11 @@ class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase } $this->assertEquals($expected, $actual, $message); } + + private function checkIfFinderIsAvailable() + { + if (!class_exists('Symfony\\Component\\Finder\\Finder')) { + $this->markTestSkipped('Finder component is not available'); + } + } }