src/Context/ApiContext.php
public function assertResponseIs($group) {
        $this->requireResponse();
        $range = $this->getResponseCodeGroupRange($group);

        try {
            Assertion::range($code = $this->response->getStatusCode(), $range['min'], $range['max']);
        } catch (AssertionFailure $e) {
            throw new AssertionFailedException(sprintf(
                'Expected response group "%s", got "%s" (response code: %d).',
                $group,
                $this->getResponseGroup($code),
                $code
            ));
        }
    }
public function assertResponseIs($group) {
        $this->requireResponse();
        $range = $this->getResponseCodeGroupRange($group);

        try {
            Assertion::range($code = $this->response->getStatusCode(), $range['min'], $range['max']);
        } catch (AssertionFailure $e) {
            throw new AssertionFailedException(sprintf(
                'Expected response group "%s", got "%s" (response code: %d).',
                $group,
                $this->getResponseGroup($code),
                $code
            ));
        }
    }
public function assertResponseIs ( $ group ) { $ this -> requireResponse ( ) ; $ range = $ this -> getResponseCodeGroupRange ( $ group ) ; try { Assertion :: range ( $ code = $ this -> response -> getStatusCode ( ) , $ range [ 'min' ] , $ range [ 'max' ] ) ; } catch ( AssertionFailure $ e ) { throw new AssertionFailedException ( sprintf ( 'Expected response group "%s", got "%s" (response code: %d).' , $ group , $ this -> getResponseGroup ( $ code ) , $ code ) ) ; } }
Checks if the HTTP response code is in a group

Allowed groups are:

- informational
- success
- redirection
- client error
- server error

@param string $group Name of the group that the response code should be in
@throws AssertionFailedException
@return void

@Then the response is :group
Checks if the HTTP response code is in a group