diff options
author | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-08-04 17:50:34 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-08-04 17:50:34 +0200 |
commit | 46b77928f746a4231d064774b5b67fd892c7ce86 (patch) | |
tree | e3ea690b3f0def1744ddae758923cf92171ef985 /vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/PhpFileLoaderTest.php | |
parent | 68abd9c71b1d2f7bb2e9d21819584d1d15005b25 (diff) | |
download | wallabag-46b77928f746a4231d064774b5b67fd892c7ce86.tar.gz wallabag-46b77928f746a4231d064774b5b67fd892c7ce86.tar.zst wallabag-46b77928f746a4231d064774b5b67fd892c7ce86.zip |
rm vendor
Diffstat (limited to 'vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/PhpFileLoaderTest.php')
-rw-r--r-- | vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/PhpFileLoaderTest.php | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/PhpFileLoaderTest.php b/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/PhpFileLoaderTest.php deleted file mode 100644 index 18b166fc..00000000 --- a/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/PhpFileLoaderTest.php +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Routing\Tests\Loader; | ||
13 | |||
14 | use Symfony\Component\Config\FileLocator; | ||
15 | use Symfony\Component\Routing\Loader\PhpFileLoader; | ||
16 | |||
17 | class PhpFileLoaderTest extends \PHPUnit_Framework_TestCase | ||
18 | { | ||
19 | protected function setUp() | ||
20 | { | ||
21 | if (!class_exists('Symfony\Component\Config\FileLocator')) { | ||
22 | $this->markTestSkipped('The "Config" component is not available'); | ||
23 | } | ||
24 | } | ||
25 | |||
26 | public function testSupports() | ||
27 | { | ||
28 | $loader = new PhpFileLoader($this->getMock('Symfony\Component\Config\FileLocator')); | ||
29 | |||
30 | $this->assertTrue($loader->supports('foo.php'), '->supports() returns true if the resource is loadable'); | ||
31 | $this->assertFalse($loader->supports('foo.foo'), '->supports() returns true if the resource is loadable'); | ||
32 | |||
33 | $this->assertTrue($loader->supports('foo.php', 'php'), '->supports() checks the resource type if specified'); | ||
34 | $this->assertFalse($loader->supports('foo.php', 'foo'), '->supports() checks the resource type if specified'); | ||
35 | } | ||
36 | |||
37 | public function testLoadWithRoute() | ||
38 | { | ||
39 | $loader = new PhpFileLoader(new FileLocator(array(__DIR__.'/../Fixtures'))); | ||
40 | $routeCollection = $loader->load('validpattern.php'); | ||
41 | $routes = $routeCollection->all(); | ||
42 | |||
43 | $this->assertCount(2, $routes, 'Two routes are loaded'); | ||
44 | $this->assertContainsOnly('Symfony\Component\Routing\Route', $routes); | ||
45 | |||
46 | foreach ($routes as $route) { | ||
47 | $this->assertSame('/blog/{slug}', $route->getPath()); | ||
48 | $this->assertSame('MyBlogBundle:Blog:show', $route->getDefault('_controller')); | ||
49 | $this->assertSame('{locale}.example.com', $route->getHost()); | ||
50 | $this->assertSame('RouteCompiler', $route->getOption('compiler_class')); | ||
51 | $this->assertEquals(array('GET', 'POST', 'PUT', 'OPTIONS'), $route->getMethods()); | ||
52 | $this->assertEquals(array('https'), $route->getSchemes()); | ||
53 | } | ||
54 | } | ||
55 | } | ||