Exemplo n.º 1
0
 /**
  * method setter
  * @param string $method
  * @throws InvalidArgumentException
  */
 public function setMethod($method)
 {
     $method = strtoupper($method);
     if (!Verb::valid($method)) {
         throw new InvalidArgumentException(sprintf('Invalid method type: %s, expects: [%s]', $method, implode(', ', Verb::options())));
     }
     $this->method = $method;
 }
Exemplo n.º 2
0
 public function testOptionsMethodRequestAllMethods()
 {
     $this->assertEquals([Verb::GET, Verb::HEAD, Verb::POST, Verb::PUT, Verb::DEL, Verb::OPTIONS, Verb::PATCH], Verb::options());
 }