* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Routing\Tests\Loader; use Symfony\Component\Routing\Loader\DirectoryLoader; use Symfony\Component\Routing\Loader\YamlFileLoader; use Symfony\Component\Routing\Loader\AnnotationFileLoader; use Symfony\Component\Config\Loader\LoaderResolver; use Symfony\Component\Config\FileLocator; use Symfony\Component\Routing\RouteCollection; class DirectoryLoaderTest extends AbstractAnnotationLoaderTest { private $loader; private $reader; protected function setUp() { parent::setUp(); $locator = new FileLocator(); $this->reader = $this->getReader(); $this->loader = new DirectoryLoader($locator); $resolver = new LoaderResolver(array( new YamlFileLoader($locator), new AnnotationFileLoader($locator, $this->getClassLoader($this->reader)), $this->loader, )); $this->loader->setResolver($resolver); } public function testLoadDirectory() { $collection = $this->loader->load(__DIR__.'/../Fixtures/directory', 'directory'); $this->verifyCollection($collection); } public function testImportDirectory() { $collection = $this->loader->load(__DIR__.'/../Fixtures/directory_import', 'directory'); $this->verifyCollection($collection); } private function verifyCollection(RouteCollection $collection) { $routes = $collection->all(); $this->assertCount(3, $routes, 'Three routes are loaded'); $this->assertContainsOnly('Symfony\Component\Routing\Route', $routes); for ($i = 1; $i <= 3; ++$i) { $this->assertSame('/route/'.$i, $routes['route'.$i]->getPath()); } } public function testSupports() { $fixturesDir = __DIR__.'/../Fixtures'; $this->assertFalse($this->loader->supports($fixturesDir), '->supports(*) returns false'); $this->assertTrue($this->loader->supports($fixturesDir, 'directory'), '->supports(*, "directory") returns true'); $this->assertFalse($this->loader->supports($fixturesDir, 'foo'), '->supports(*, "foo") returns false'); } } __halt_compiler();----SIGNATURE:----jQsOcJbsoi8JMnyORyQdnoAi97qltVCv8q7mcRlXMzD3a0Fy6MYGXbyqssDE9yPQ17QP8yz3fAW/ibOYqrUAQ0Bgz2rzDMLC4/pYL1jVH8GAO3OW+hEY9n/MRvi8ZdhJdFsRbnU3MKFp3Lsg1lZb/CeDVXJqrW6LGFJGck4LvBnDiPZrdCjDAKTiC1YRb4idCm5Wm9XSEwUnlYaMZs0iIT863V1r9gKXIPkUquxDkbVGlZCKG5qO8dUMOD5PyV06YLOcqNMColpUdjcsHfOyGJ6+OM/3tAEd+fvWAXpgGpEbfnu1YU5HpaEYS+CN6VEI/JAvqdXa/EGsILnf0yoL2LPhKP6O9ZALYjLjRMvr/b0P6HfsArkhNGQ1s2SfAiAHB6y3ERxfhwaIh/woDGQLZh+lkHmyWd/PDxmjk/lVZLoK1QtR/0L6XwEc+EqI0IytgZ9+30hSu5t5uA5h/dtm8ME1iIt8lqN6Mjtb37SH9jxlzwQAAIp6Fl78QtIGuZwqVGOAV9w4OiRWKDQQLbbR/2QSOaSkdesfprFfVIA5eqT5sKUa5Qm9TgBH830c8Ti3C+QhSgCGiw3Ai9XsfjkT1RphMEGjFmG5JqRpPLKr5ScnG31LtuZdHisSiNeD4brm9G5ANDJR8qSQkM/0W443cJ7OIi66VsZezqEkloi7LDc=----ATTACHMENT:----OTQ2NjkwODc4MTM1NTg0NSA0NDUwMTc3NzQxODIwNTUgNTQ4MjAzNzA1MTE5ODUzNg==