Procházet zdrojové kódy

[Tests] Skip Routing annotation tests when Doctrine is not available.

Joseph Bielawski před 13 roky
rodič
revize
d3e9104b52

+ 7 - 0
tests/Symfony/Tests/Component/Routing/Loader/AbstractAnnotationLoaderTest.php

@@ -18,6 +18,13 @@ use Symfony\Component\Routing\RouteCollection;
 
 abstract class AbstractAnnotationLoaderTest extends \PHPUnit_Framework_TestCase
 {
+    public function setUp()
+    {
+        if (!class_exists('Doctrine\\Common\\Version')) {
+            $this->markTestSkipped('Doctrine is not available.');
+        }
+    }
+
     public function getReader()
     {
         return $this->getMockBuilder('Doctrine\Common\Annotations\Reader')

+ 2 - 0
tests/Symfony/Tests/Component/Routing/Loader/AnnotationClassLoaderTest.php

@@ -25,6 +25,8 @@ class AnnotationClassLoaderTest extends AbstractAnnotationLoaderTest
 
     public function setUp()
     {
+        parent::setUp();
+
         $this->loader = $this->getClassLoader($this->getReader());
     }
 

+ 2 - 0
tests/Symfony/Tests/Component/Routing/Loader/AnnotationDirectoryLoaderTest.php

@@ -26,6 +26,8 @@ class AnnotationDirectoryLoaderTest extends AbstractAnnotationLoaderTest
 
     public function setUp()
     {
+        parent::setUp();
+
         $this->reader = $this->getReader();
         $this->loader = new AnnotationDirectoryLoader(new FileLocator(), $this->getClassLoader($this->reader));
     }

+ 2 - 0
tests/Symfony/Tests/Component/Routing/Loader/AnnotationFileLoaderTest.php

@@ -26,6 +26,8 @@ class AnnotationFileLoaderTest extends AbstractAnnotationLoaderTest
 
     public function setUp()
     {
+        parent::setUp();
+
         $this->reader = $this->getReader();
         $this->loader = new AnnotationFileLoader(new FileLocator(), $this->getClassLoader($this->reader));
     }