Beispiel #1
0
 /**
  * @dataProvider routeProvider
  * @param        Hostname $route
  * @param        string   $hostname
  * @param        array    $params
  */
 public function testMatching(Hostname $route, $hostname, array $params = null)
 {
     $request = new Request();
     $request->setUri('http://' . $hostname . '/');
     $match = $route->match($request);
     if ($params === null) {
         $this->assertNull($match);
     } else {
         $this->assertInstanceOf('Zend\\Mvc\\Router\\Http\\RouteMatch', $match);
         foreach ($params as $key => $value) {
             $this->assertEquals($value, $match->getParam($key));
         }
     }
 }
Beispiel #2
0
 public function testNoMatchWithoutUriMethod()
 {
     $route = new Hostname('example.com');
     $request = new BaseRequest();
     $this->assertNull($route->match($request));
 }