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\AnnotationDirectoryLoader
;
15 use Symfony\Component\Config\FileLocator
;
17 class AnnotationDirectoryLoaderTest
extends AbstractAnnotationLoaderTest
22 protected function setUp()
26 $this->reader
= $this->getReader();
27 $this->loader
= new AnnotationDirectoryLoader(new FileLocator(), $this->getClassLoader($this->reader
));
30 public function testLoad()
32 $this->reader
->expects($this->exactly(2))->method('getClassAnnotation');
35 ->expects($this->any())
36 ->method('getMethodAnnotations')
37 ->will($this->returnValue(array()))
40 $this->loader
->load(__DIR__
.'/../Fixtures/AnnotatedClasses');
43 public function testSupports()
45 $fixturesDir = __DIR__
.'/../Fixtures';
47 $this->assertTrue($this->loader
->supports($fixturesDir), '->supports() returns true if the resource is loadable');
48 $this->assertFalse($this->loader
->supports('foo.foo'), '->supports() returns true if the resource is loadable');
50 $this->assertTrue($this->loader
->supports($fixturesDir, 'annotation'), '->supports() checks the resource type if specified');
51 $this->assertFalse($this->loader
->supports($fixturesDir, 'foo'), '->supports() checks the resource type if specified');