From 571c984625685bde9167f798b2a216f287df9177 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sat, 29 Jan 2011 20:55:17 +0100 Subject: [PATCH] [Validator] Skip tests that rely on Doctrine being present if its not --- .../Tests/Component/Validator/ValidatorFactoryTest.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/Symfony/Tests/Component/Validator/ValidatorFactoryTest.php b/tests/Symfony/Tests/Component/Validator/ValidatorFactoryTest.php index bd0fbc2eb6..b71d31a24a 100644 --- a/tests/Symfony/Tests/Component/Validator/ValidatorFactoryTest.php +++ b/tests/Symfony/Tests/Component/Validator/ValidatorFactoryTest.php @@ -75,6 +75,9 @@ class ValidatorFactoryTest extends \PHPUnit_Framework_TestCase public function testBuildDefaultFromAnnotations() { + if (!class_exists('Doctrine\Common\Annotations\AnnotationReader')) { + $this->markTestSkipped('Doctrine is required for this test'); + } $factory = ValidatorFactory::buildDefault(); $context = new ValidatorContext(); @@ -87,6 +90,9 @@ class ValidatorFactoryTest extends \PHPUnit_Framework_TestCase public function testBuildDefaultFromAnnotationsWithCustomNamespaces() { + if (!class_exists('Doctrine\Common\Annotations\AnnotationReader')) { + $this->markTestSkipped('Doctrine is required for this test'); + } $factory = ValidatorFactory::buildDefault(array(), true, array( 'myns' => 'My\\Namespace\\', )); @@ -142,6 +148,9 @@ class ValidatorFactoryTest extends \PHPUnit_Framework_TestCase public function testBuildDefaultFromMultipleLoaders() { + if (!class_exists('Doctrine\Common\Annotations\AnnotationReader')) { + $this->markTestSkipped('Doctrine is required for this test'); + } $xmlPath = __DIR__.'/Mapping/Loader/constraint-mapping.xml'; $yamlPath = __DIR__.'/Mapping/Loader/constraint-mapping.yml'; $factory = ValidatorFactory::buildDefault(array($xmlPath, $yamlPath), true, null, 'loadMetadata');