diff options
author | Remi Collet <[email protected]> | 2019-10-11 10:30:57 +0200 |
---|---|---|
committer | Christian Flothmann <[email protected]> | 2019-10-14 10:49:39 +0200 |
commit | ff9f1ccf2435fe242c17e33e5598c994eceb54bc (patch) | |
tree | ccd3e536db0b221611028364288602968b858c39 /test/HTML5/Parser | |
parent | b84b9d0bc8f0244866f15664294b1537e9d059de (diff) |
Fix Trying to access array offset on value of type null
Diffstat (limited to 'test/HTML5/Parser')
-rw-r--r-- | test/HTML5/Parser/TokenizerTest.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/HTML5/Parser/TokenizerTest.php b/test/HTML5/Parser/TokenizerTest.php index 153dd23..6c90686 100644 --- a/test/HTML5/Parser/TokenizerTest.php +++ b/test/HTML5/Parser/TokenizerTest.php @@ -26,7 +26,8 @@ class TokenizerTest extends \Masterminds\HTML5\Tests\TestCase if (is_array($expects)) { $this->assertEquals($expects, $event['data'], "Event $type should equal " . print_r($expects, true) . ': ' . print_r($event, true)); } else { - $this->assertEquals($expects, $event['data'][0], "Event $type should equal $expects: " . print_r($event, true)); + $d = (is_array($event['data']) ? $event['data'][0] : null); + $this->assertEquals($expects, $d, "Event $type should equal $expects: " . print_r($event, true)); } } |