src/Context/ApiContext.php
public function assertResponseBodyJsonArrayLength($length) {
        $this->requireResponse();
        $length = (int) $length;

        try {
            Assertion::count(
                $body = $this->getResponseBodyArray(),
                $length,
                sprintf(
                    'Expected response body to be a JSON array with %d entr%s, got %d: "%s".',
                    $length,
                    $length === 1 ? 'y' : 'ies',
                    count($body),
                    json_encode($body, JSON_PRETTY_PRINT)
                )
            );
        } catch (AssertionFailure $e) {
            throw new AssertionFailedException($e->getMessage());
        }
    }
public function assertResponseBodyJsonArrayLength($length) {
        $this->requireResponse();
        $length = (int) $length;

        try {
            Assertion::count(
                $body = $this->getResponseBodyArray(),
                $length,
                sprintf(
                    'Expected response body to be a JSON array with %d entr%s, got %d: "%s".',
                    $length,
                    $length === 1 ? 'y' : 'ies',
                    count($body),
                    json_encode($body, JSON_PRETTY_PRINT)
                )
            );
        } catch (AssertionFailure $e) {
            throw new AssertionFailedException($e->getMessage());
        }
    }
public function assertResponseBodyJsonArrayLength ( $ length ) { $ this -> requireResponse ( ) ; $ length = ( int ) $ length ; try { Assertion :: count ( $ body = $ this -> getResponseBodyArray ( ) , $ length , sprintf ( 'Expected response body to be a JSON array with %d entr%s, got %d: "%s".' , $ length , $ length === 1 ? 'y' : 'ies' , count ( $ body ) , json_encode ( $ body , JSON_PRETTY_PRINT ) ) ) ; } catch ( AssertionFailure $ e ) { throw new AssertionFailedException ( $ e -> getMessage ( ) ) ; } }
Assert that the response body contains an array with a specific length

@param int $length The length of the array
@throws AssertionFailedException
@return void

@Then the response body is a JSON array of length :length
Assert that the response body contains an array with a specific length