4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Routing\Tests\Loader
;
14 use Symfony\Component\Routing\Loader\AnnotationFileLoader
;
15 use Symfony\Component\Config\FileLocator
;
17 class AnnotationFileLoaderTest
extends AbstractAnnotationLoaderTest
22 protected function setUp()
26 $this->reader
= $this->getReader();
27 $this->loader
= new AnnotationFileLoader(new FileLocator(), $this->getClassLoader($this->reader
));
30 public function testLoad()
32 $this->reader
->expects($this->once())->method('getClassAnnotation');
34 $this->loader
->load(__DIR__
.'/../Fixtures/AnnotatedClasses/FooClass.php');
37 public function testSupports()
39 $fixture = __DIR__
.'/../Fixtures/annotated.php';
41 $this->assertTrue($this->loader
->supports($fixture), '->supports() returns true if the resource is loadable');
42 $this->assertFalse($this->loader
->supports('foo.foo'), '->supports() returns true if the resource is loadable');
44 $this->assertTrue($this->loader
->supports($fixture, 'annotation'), '->supports() checks the resource type if specified');
45 $this->assertFalse($this->loader
->supports($fixture, 'foo'), '->supports() checks the resource type if specified');