* * 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:----nKLWS91gxUKzh2UX7U8XWn4LIsGGo5clTvYdGkJWcdEmBVxu99OhwZwKj/en5hfxr2led9bUF3v/ldKBl5FaAJ11Nx+d+U10IMC/P8Wkfv9qMNvk+9ADCODFZYPMOMYDZs/fFIywGoHVGlGx/Dzc7l6rUOQMqcWN53IiyRFEDXXYRP924LkKvSTcCw2itnTHa19TlsV5A/Zzrf7hcegyb7VDOJs9FzC/EK47Sd87XEil4sg5aRUzN6xgN58i9d+fwT5X/7CaD/zrxDQWgOyZhiXK57npMlap/xKF4PlnYu7AxwE3W86lGNFC0R0Uuq3TsTnJyHMERHPhW1xIOVG6VxNsEb6ZdisjwwbnyUJjDy92Q4brHzSRImCST4oh0H+FTDhgTtwN7p4cLnrVD2QJErlBKGM1v6Ig/adnT6xa43hLMjd236hgTUvD6ZGX65H6JSYp3ypzpLtDhdbw6U1+B5KtKBiC5uQeRTE/D7klHlPbCKZwmCI40ugZ3hcyz+hpnMANwmKwTsVTo/VGXyD0kD0F+Ll2L/L4Ls17eYn8lnqdS7n1IzaAmVvpwRbh6hg4p3oZmFWPANHMcWWrTrTN9KExJ7IqLmxUukgtsDxXCEirPYuG0UDGm4RfFJSZFNlPNrsiS6Bo7yccq5n8+UDVl3lQaJ1ciSEITYC1+4b6sqQ=----ATTACHMENT:----Mzk0MzAzMzAyOTgzNjgzOSAzNTE2OTgyMTk4MzE4NjUzIDMxMDYwODg5MzA1MTk1NTk=