runParserTest( '
{{@45#content}}
', ['45' => 'Testing
'], 'Testing
', ); } public function test_include_simple_inline_text_with_existing_siblings() { $this->runParserTest( '{{@45#content}} Hithere!
', ['45' => 'Testing
'], 'Testing Hithere!
', ); } public function test_include_simple_inline_text_within_other_text() { $this->runParserTest( 'Hello {{@45#content}}there!
', ['45' => 'Testing
'], 'Hello Testingthere!
', ); } protected function runParserTest(string $html, array $contentById, string $expected) { $parser = new PageIncludeParser($html, function (int $id) use ($contentById) { return $contentById[strval($id)] ?? ''; }); $result = $parser->parse(); $this->assertEquals($expected, $result); } }