AnnotationGlobLoaderTest.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
  5. *
  6. * For the full copyright and license information, please view the LICENSE
  7. * file that was distributed with this source code.
  8. */
  9. namespace Symfony\Tests\Component\Routing\Loader;
  10. use Symfony\Component\Routing\Loader\LoaderResolver;
  11. use Symfony\Component\Routing\Loader\AnnotationGlobLoader;
  12. use Symfony\Component\Routing\Route;
  13. use Symfony\Component\Routing\RouteCollection;
  14. class AnnotationGlobLoaderTest extends \PHPUnit_Framework_TestCase
  15. {
  16. /**
  17. * @covers Symfony\Component\Routing\Loader\AnnotationGlobLoader::supports
  18. */
  19. public function testSupports()
  20. {
  21. $annotationClassLoader = $this->getMockBuilder('Symfony\Component\Routing\Loader\AnnotationClassLoader')
  22. ->disableOriginalConstructor()
  23. ->getMockForAbstractClass();
  24. $loader = new AnnotationGlobLoader($annotationClassLoader);
  25. $this->assertTrue($loader->supports('*'), '->supports() returns true if the resource is loadable');
  26. $this->assertFalse($loader->supports('foo.foo'), '->supports() returns true if the resource is loadable');
  27. $this->assertTrue($loader->supports('*', 'annotation'), '->supports() checks the resource type if specified');
  28. $this->assertFalse($loader->supports('*', 'foo'), '->supports() checks the resource type if specified');
  29. }
  30. }