composer update
This commit is contained in:
@@ -472,9 +472,6 @@ class PhpMatcherDumperTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $dumper
|
||||
*/
|
||||
private function generateDumpedMatcher(RouteCollection $collection, $redirectableStub = false)
|
||||
{
|
||||
$options = array('class' => $this->matcherClass);
|
||||
|
@@ -141,6 +141,25 @@ class RedirectableUrlMatcherTest extends UrlMatcherTest
|
||||
$this->assertSame(array('_route' => 'foo'), $matcher->match('/foo'));
|
||||
}
|
||||
|
||||
public function testFallbackPage()
|
||||
{
|
||||
$coll = new RouteCollection();
|
||||
$coll->add('foo', new Route('/foo/'));
|
||||
$coll->add('bar', new Route('/{name}'));
|
||||
|
||||
$matcher = $this->getUrlMatcher($coll);
|
||||
$matcher->expects($this->once())->method('redirect')->with('/foo/', 'foo')->will($this->returnValue(array('_route' => 'foo')));
|
||||
$this->assertSame(array('_route' => 'foo'), $matcher->match('/foo'));
|
||||
|
||||
$coll = new RouteCollection();
|
||||
$coll->add('foo', new Route('/foo'));
|
||||
$coll->add('bar', new Route('/{name}/'));
|
||||
|
||||
$matcher = $this->getUrlMatcher($coll);
|
||||
$matcher->expects($this->once())->method('redirect')->with('/foo', 'foo')->will($this->returnValue(array('_route' => 'foo')));
|
||||
$this->assertSame(array('_route' => 'foo'), $matcher->match('/foo/'));
|
||||
}
|
||||
|
||||
public function testMissingTrailingSlashAndScheme()
|
||||
{
|
||||
$coll = new RouteCollection();
|
||||
|
@@ -455,6 +455,9 @@ class UrlMatcherTest extends TestCase
|
||||
{
|
||||
$coll = new RouteCollection();
|
||||
$route = new Route('/foo/{bar}');
|
||||
$route->setCondition('request.getBaseUrl() == "/bar"');
|
||||
$coll->add('bar', $route);
|
||||
$route = new Route('/foo/{bar}');
|
||||
$route->setCondition('request.getBaseUrl() == "/sub/front.php" and request.getPathInfo() == "/foo/bar"');
|
||||
$coll->add('foo', $route);
|
||||
$matcher = $this->getUrlMatcher($coll, new RequestContext('/sub/front.php'));
|
||||
@@ -680,6 +683,15 @@ class UrlMatcherTest extends TestCase
|
||||
$this->assertEquals('b', $matcher->match('/bar/abc.123')['_route']);
|
||||
}
|
||||
|
||||
public function testSlashVariant()
|
||||
{
|
||||
$coll = new RouteCollection();
|
||||
$coll->add('a', new Route('/foo/{bar}', array(), array('bar' => '.*')));
|
||||
|
||||
$matcher = $this->getUrlMatcher($coll);
|
||||
$this->assertEquals('a', $matcher->match('/foo/')['_route']);
|
||||
}
|
||||
|
||||
protected function getUrlMatcher(RouteCollection $routes, RequestContext $context = null)
|
||||
{
|
||||
return new UrlMatcher($routes, $context ?: new RequestContext());
|
||||
|
Reference in New Issue
Block a user