XmlFileLoaderTest.php 1.2 KB

123456789101112131415161718192021222324252627282930313233
  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\XmlFileLoader;
  12. use Symfony\Component\Routing\Route;
  13. use Symfony\Component\Routing\RouteCollection;
  14. class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase
  15. {
  16. /**
  17. * @covers Symfony\Component\Routing\Loader\XmlFileLoader::supports
  18. */
  19. public function testSupports()
  20. {
  21. $loader = new XmlFileLoader();
  22. $this->assertTrue($loader->supports('foo.xml'), '->supports() returns true if the resource is loadable');
  23. $this->assertFalse($loader->supports('foo.foo'), '->supports() returns true if the resource is loadable');
  24. $this->assertTrue($loader->supports('foo.xml', 'xml'), '->supports() checks the resource type if specified');
  25. $this->assertFalse($loader->supports('foo.xml', 'foo'), '->supports() checks the resource type if specified');
  26. }
  27. }