Jan Brecka 11 rokov pred
rodič
commit
de09c5e371

+ 9 - 6
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');
+        }
+    }
 }