public function test_match() { $url = new Url('foo/bar'); $this->assertTrue($url->match('foo/{name}')); $this->assertFalse($url->match('foo')); $this->assertTrue($url->match('foo/{name}/{alias?}')); $this->assertFalse($url->match('foo/{name}/{alias}')); $this->assertTrue($url->match('foo/{id}', ['id' => '[a-z]+'])); $this->assertFalse($url->match('foo/{id}', ['id' => '[0-9]+'])); }