Exemple #1
0
 public function testMethods()
 {
     $route = new Route('name', 'sourceRoute', 'action');
     $this->assertEquals($route->getMethods(), ['GET']);
     $route->setMethods(['POST']);
     $this->assertEquals($route->getMethods(), ['POST']);
     $route->addMethod('HEAD');
     $this->assertEquals($route->getMethods(), ['POST', 'HEAD']);
     $route->removeMethod('POST');
     $this->assertEquals($route->getMethods(), ['HEAD']);
     $this->assertEquals($route->isSatisfiedByMethod('HEAD'), true);
     $this->assertEquals($route->isSatisfiedByMethod('GET'), false);
     $route->addMethod('GET');
     $this->assertEquals($route->isSatisfiedByMethod('GET'), true);
 }