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

        try {
            Assertion::notSame(
                $actual = $this->response->getStatusCode(),
                $this->validateResponseCode($code),
                sprintf('Did not expect response code %d.', $actual)
            );
        } catch (AssertionFailure $e) {
            throw new AssertionFailedException($e->getMessage());
        }
    }
public function assertResponseCodeIsNot($code) {
        $this->requireResponse();

        try {
            Assertion::notSame(
                $actual = $this->response->getStatusCode(),
                $this->validateResponseCode($code),
                sprintf('Did not expect response code %d.', $actual)
            );
        } catch (AssertionFailure $e) {
            throw new AssertionFailedException($e->getMessage());
        }
    }
public function assertResponseCodeIsNot ( $ code ) { $ this -> requireResponse ( ) ; try { Assertion :: notSame ( $ actual = $ this -> response -> getStatusCode ( ) , $ this -> validateResponseCode ( $ code ) , sprintf ( 'Did not expect response code %d.' , $ actual ) ) ; } catch ( AssertionFailure $ e ) { throw new AssertionFailedException ( $ e -> getMessage ( ) ) ; } }
Assert the HTTP response code is not a specific code

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

@Then the response code is not :code
Assert the HTTP response code is not a specific code