Fix null check
parent
9f3e2105da
commit
29134d5a1d
|
@ -65,8 +65,8 @@ class IOMock extends BufferIO
|
||||||
$this->expectations = $expectations;
|
$this->expectations = $expectations;
|
||||||
$inputs = [];
|
$inputs = [];
|
||||||
foreach ($expectations as $expect) {
|
foreach ($expectations as $expect) {
|
||||||
if (isset($expect['ask'], $expect['reply'])) {
|
if (isset($expect['ask'])) {
|
||||||
if (!is_string($expect['reply'])) {
|
if (!array_key_exists('reply', $expect) || !is_string($expect['reply'])) {
|
||||||
throw new \LogicException('A question\'s reply must be a string, use empty string for null replies');
|
throw new \LogicException('A question\'s reply must be a string, use empty string for null replies');
|
||||||
}
|
}
|
||||||
$inputs[] = $expect['reply'];
|
$inputs[] = $expect['reply'];
|
||||||
|
|
Loading…
Reference in New Issue