AbstractAnnotationLoaderTest.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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\Routing\Route;
  12. abstract class AbstractAnnotationLoaderTest extends \PHPUnit_Framework_TestCase
  13. {
  14. public function setUp()
  15. {
  16. if (!class_exists('Doctrine\\Common\\Version')) {
  17. $this->markTestSkipped('Doctrine is not available.');
  18. }
  19. }
  20. public function getReader()
  21. {
  22. return $this->getMockBuilder('Doctrine\Common\Annotations\Reader')
  23. ->disableOriginalConstructor()
  24. ->getMock()
  25. ;
  26. }
  27. public function getClassLoader($reader)
  28. {
  29. return $this->getMockBuilder('Symfony\Component\Routing\Loader\AnnotationClassLoader')
  30. ->setConstructorArgs(array($reader))
  31. ->getMockForAbstractClass()
  32. ;
  33. }
  34. }