eZ\Bundle\EzPublishRestBundle\Features\Context\RestClient\DriverInterface::getStatusCode PHP Method

getStatusCode() public method

Get response status code.
public getStatusCode ( ) : string
return string
    public function getStatusCode();

Usage Example

Example #1
0
    /**
     * @Then response status code is :code
     */
    public function assertStatusCode($code)
    {
        $exceptionMessage = '';
        if ($code != $this->restDriver->getStatusCode() && $code >= 200 && $code < 400) {
            $errorMessage = $this->getResponseObject();
            if ($errorMessage instanceof ErrorMessage) {
                $exceptionMessage = <<<EOF

Exception ({$errorMessage->code}): {$errorMessage->description}

{$errorMessage->trace}
EOF;
            }
        }
        Assertion::assertEquals($code, $this->restDriver->getStatusCode(), "Expected status code '{$code}' found '{$this->restDriver->getStatusCode()}'{$exceptionMessage}");
    }
All Usage Examples Of eZ\Bundle\EzPublishRestBundle\Features\Context\RestClient\DriverInterface::getStatusCode