|
|
|
|
|
|
|
|
* @throws \Exception |
|
|
* @throws \Exception |
|
|
*/ |
|
|
*/ |
|
|
public function theResponseShouldContainOnlyComments($number) { |
|
|
public function theResponseShouldContainOnlyComments($number) { |
|
|
if (count($this->response) !== (int)$number) { |
|
|
|
|
|
throw new \Exception("Found more comments than $number (" . count($this->response) . ")"); |
|
|
|
|
|
|
|
|
$count = 0; |
|
|
|
|
|
if ($this->response !== null) { |
|
|
|
|
|
$count = count($this->response); |
|
|
|
|
|
} |
|
|
|
|
|
if ($count !== (int)$number) { |
|
|
|
|
|
throw new \Exception("Found more comments than $number (" . $count . ")"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|