Pantheon\Terminus\FeatureTests\FeatureContext::iShouldHaveRecords PHP Method

iShouldHaveRecords() public method

Checks the number of records returned against a given quantity
public iShouldHaveRecords ( [integer] $number ) : [void]
$number [integer]
return [void]
    public function iShouldHaveRecords($number)
    {
        preg_match("/.*(\\[.*\\]).*/", str_replace("\n", '', $this->output), $matches);
        $records = json_decode($matches[1]);
        if ((int) $number != count($records)) {
            throw new \Exception("Wanted {$number} records, got " . count($records) . '.');
        }
        return true;
    }