src/Context/ApiContext.php
public function assertResponseCodeIs($code) {
        $this->requireResponse();

        try {
            Assertion::same(
                $actual = $this->response->getStatusCode(),
                $expected = $this->validateResponseCode($code),
                sprintf('Expected response code %d, got %d.', $expected, $actual)
            );
        } catch (AssertionFailure $e) {
            throw new AssertionFailedException($e->getMessage());
        }
    }
public function assertResponseCodeIs($code) {
        $this->requireResponse();

        try {
            Assertion::same(
                $actual = $this->response->getStatusCode(),
                $expected = $this->validateResponseCode($code),
                sprintf('Expected response code %d, got %d.', $expected, $actual)
            );
        } catch (AssertionFailure $e) {
            throw new AssertionFailedException($e->getMessage());
        }
    }
public function assertResponseCodeIs ( $ code ) { $ this -> requireResponse ( ) ; try { Assertion :: same ( $ actual = $ this -> response -> getStatusCode ( ) , $ expected = $ this -> validateResponseCode ( $ code ) , sprintf ( 'Expected response code %d, got %d.' , $ expected , $ actual ) ) ; } catch ( AssertionFailure $ e ) { throw new AssertionFailedException ( $ e -> getMessage ( ) ) ; } }
Assert the HTTP response code

@param int $code The HTTP response code
@throws AssertionFailedException
@return void

@Then the response code is :code
Assert the HTTP response code