Skip to content

Commit ff9f1cc

Browse files
remicolletxabbuh
authored andcommitted
Fix Trying to access array offset on value of type null
1 parent b84b9d0 commit ff9f1cc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/HTML5/Parser/TokenizerTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ public function assertEventEquals($type, $expects, $event)
2626
if (is_array($expects)) {
2727
$this->assertEquals($expects, $event['data'], "Event $type should equal " . print_r($expects, true) . ': ' . print_r($event, true));
2828
} else {
29-
$this->assertEquals($expects, $event['data'][0], "Event $type should equal $expects: " . print_r($event, true));
29+
$d = (is_array($event['data']) ? $event['data'][0] : null);
30+
$this->assertEquals($expects, $d, "Event $type should equal $expects: " . print_r($event, true));
3031
}
3132
}
3233

0 commit comments

Comments
 (0)