1
0
Fork 0

Fix null check

pull/11499/head
Jordi Boggiano 2023-06-07 16:34:58 +02:00
parent 9f3e2105da
commit 29134d5a1d
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 2 additions and 2 deletions

View File

@ -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'];