/**
  * @test
  * @covers Asd\Router\Route::getMethod
  */
 public function getMethod_returnsMethodInUpperCase()
 {
     $route = new Route('get', '', $this->callbackStub);
     $this->assertEquals('GET', $route->getMethod());
     $route = new Route('post', '', $this->callbackStub);
     $this->assertEquals('POST', $route->getMethod());
 }
示例#2
0
 /**
  * Check if the route compared has the same properties
  * @param  Route  $route route to be compared
  * @return boolean
  */
 public function equals(Route $route) : bool
 {
     if ($this->method !== $route->getMethod()) {
         return false;
     }
     if ($this->path !== $route->getPath()) {
         return false;
     }
     return true;
 }