AbstractAnnotationLoaderTest.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Tests\Component\Routing\Loader;
  11. use Symfony\Component\Config\Loader\LoaderResolver;
  12. use Symfony\Component\Routing\Loader\AnnotationFileLoader;
  13. use Symfony\Component\Routing\Route;
  14. use Symfony\Component\Routing\RouteCollection;
  15. abstract class AbstractAnnotationLoaderTest extends \PHPUnit_Framework_TestCase
  16. {
  17. public function setUp()
  18. {
  19. if (!class_exists('Doctrine\\Common\\Version')) {
  20. $this->markTestSkipped('Doctrine is not available.');
  21. }
  22. }
  23. public function getReader()
  24. {
  25. return $this->getMockBuilder('Doctrine\Common\Annotations\Reader')
  26. ->disableOriginalConstructor()
  27. ->getMock()
  28. ;
  29. }
  30. public function getClassLoader($reader)
  31. {
  32. return $this->getMockBuilder('Symfony\Component\Routing\Loader\AnnotationClassLoader')
  33. ->setConstructorArgs(array($reader))
  34. ->getMockForAbstractClass()
  35. ;
  36. }
  37. }