4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Routing\Tests\Matcher;
14 use Symfony\Component\Routing\Matcher\Dumper\PhpMatcherDumper;
15 use Symfony\Component\Routing\RequestContext;
16 use Symfony\Component\Routing\RouteCollection;
18 class DumpedUrlMatcherTest extends UrlMatcherTest
21 * @expectedException \LogicException
22 * @expectedExceptionMessage The "schemes" requirement is only supported for URL matchers that implement RedirectableUrlMatcherInterface.
24 public function testSchemeRequirement()
26 parent::testSchemeRequirement();
30 * @expectedException \LogicException
31 * @expectedExceptionMessage The "schemes" requirement is only supported for URL matchers that implement RedirectableUrlMatcherInterface.
33 public function testSchemeAndMethodMismatch()
35 parent::testSchemeRequirement();
38 protected function getUrlMatcher(RouteCollection $routes, RequestContext $context = null)
42 $class = 'DumpedUrlMatcher'.++$i;
43 $dumper = new PhpMatcherDumper($routes);
44 eval('?>'.$dumper->dump(array('class' => $class)));
46 return new $class($context ?: new RequestContext());