Commits ------- 205f524 [Tests] Skip MimeTypeTest if running as root d3e9104 [Tests] Skip Routing annotation tests when Doctrine is not available. Discussion ---------- [Tests] Fix tests when some vendor is not available.
@@ -94,7 +94,7 @@ class MimeTypeTest extends \PHPUnit_Framework_TestCase
touch($path);
chmod($path, 0333);
- if (substr(sprintf('%o', fileperms($path)), -4) == '0333') {
+ if (get_current_user() != 'root' && substr(sprintf('%o', fileperms($path)), -4) == '0333') {
$this->setExpectedException('Symfony\Component\HttpFoundation\File\Exception\AccessDeniedException');
MimeTypeGuesser::getInstance()->guess($path);
} else {
@@ -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')
@@ -25,6 +25,8 @@ class AnnotationClassLoaderTest extends AbstractAnnotationLoaderTest
public function setUp()
+ parent::setUp();
$this->loader = $this->getClassLoader($this->getReader());
}
@@ -26,6 +26,8 @@ class AnnotationDirectoryLoaderTest extends AbstractAnnotationLoaderTest
$this->reader = $this->getReader();
$this->loader = new AnnotationDirectoryLoader(new FileLocator(), $this->getClassLoader($this->reader));
@@ -26,6 +26,8 @@ class AnnotationFileLoaderTest extends AbstractAnnotationLoaderTest
$this->loader = new AnnotationFileLoader(new FileLocator(), $this->getClassLoader($this->reader));