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

This commit is contained in:
Joseph Bielawski 2011-10-15 13:06:22 +02:00
parent 5dba01851e
commit d3e9104b52
4 changed files with 13 additions and 0 deletions

View File

@ -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')

View File

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

View File

@ -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));
}

View File

@ -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));
}