1785c3ad20f41ea3ce206dd6d3747fd1ad1aefb7
[yaffs-website] / routing / Tests / Matcher / DumpedRedirectableUrlMatcherTest.php
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\Matcher;
13
14 use Symfony\Component\Routing\Matcher\Dumper\PhpMatcherDumper;
15 use Symfony\Component\Routing\Matcher\RedirectableUrlMatcherInterface;
16 use Symfony\Component\Routing\Matcher\UrlMatcher;
17 use Symfony\Component\Routing\RequestContext;
18 use Symfony\Component\Routing\RouteCollection;
19
20 class DumpedRedirectableUrlMatcherTest extends RedirectableUrlMatcherTest
21 {
22     protected function getUrlMatcher(RouteCollection $routes, RequestContext $context = null)
23     {
24         static $i = 0;
25
26         $class = 'DumpedRedirectableUrlMatcher'.++$i;
27         $dumper = new PhpMatcherDumper($routes);
28         eval('?>'.$dumper->dump(array('class' => $class, 'base_class' => 'Symfony\Component\Routing\Tests\Matcher\TestDumpedRedirectableUrlMatcher')));
29
30         return $this->getMockBuilder($class)
31             ->setConstructorArgs(array($context ?: new RequestContext()))
32             ->setMethods(array('redirect'))
33             ->getMock();
34     }
35 }
36
37 class TestDumpedRedirectableUrlMatcher extends UrlMatcher implements RedirectableUrlMatcherInterface
38 {
39     public function redirect($path, $route, $scheme = null)
40     {
41         return array();
42     }
43 }