Ergo\Http\ResponseBuilder::methodNotAllowed PHP Method

methodNotAllowed() public method

Configures response as a '405 Method Not Allowed'
public methodNotAllowed ( )
    public function methodNotAllowed()
    {
        return $this->setStatusCode(405);
    }

Usage Example

Exemplo n.º 1
0
 public function testMethodNotAllowed()
 {
     $builder = new Http\ResponseBuilder();
     $response = $builder->methodNotAllowed()->build();
     $this->assertEquals($response->getStatus()->getCode(), 405);
     $this->assertFalse($response->hasBody());
 }