expectExceptionMessage( $expectedException );
}
$actualResult = $parser->parse( $html );
$this->assertEquals( $expectedResult, $actualResult, $message );
}
public static function provideTestParse() {
// @codingStandardsIgnoreStart Generic.Files.LineLength
return [
[
' {{foo}}
{{foo}}
', 'rawTemplate' => '{{foo}}
', 'style' => 'baz', 'styleLang' => 'css', ], 'Basic test' ], [ '{{foo}}
', null, 'Missing ', null, 'Missing tag', 'No tag found', ], [ '{{foo}}
', [ 'script' => 'bar', 'template' => '{{foo}}
', 'rawTemplate' => '{{foo}}
', 'style' => null, 'styleLang' => null, ], 'Missing ', null, 'Two style tags', 'More than one ', null, 'Empty tag', ' tag may not be empty', ], [ '{{foo}}
', null, 'Template with two root nodes', ' tag may not have multiple child tags', ], [ '{{foo}}
', [ 'script' => 'bar', 'template' => '{{foo}}
', 'rawTemplate' => '{{foo}}
', 'style' => null, 'styleLang' => null, ], 'Template with comment outside', ], [ '{{foo}}
', [ 'script' => 'bar', 'template' => '{{foo}}
', 'rawTemplate' => '{{foo}}
', 'style' => null, 'styleLang' => null, ], 'Template with comment inside', ], [ 'blah', null, 'Template with text', ' tag may not contain text', ], [ "\n\t {{foo}}\n{{bar}} \n\t {{foo}}\n{{bar}} {{foo}}\n{{bar}} \n\ttags', ], [ '{{foo}}
', [ 'script' => 'bar', 'template' => '{{foo}}
', 'rawTemplate' => '{{foo}}
', 'style' => 'baz', 'styleLang' => 'less', ], 'Style tag with lang="less"', ], [ '{{foo}}
', null, 'Style tag with invalid language', '', null, 'Scoped style tag', '', null, 'Scoped style tag with lang="less"', '', null, '', null, ' tag', ' may not have any attributes' ], [ '{{foo}}
', null, '', null, '@click attribute', "HTML parse errors:\nerror parsing attribute name\n on line 1" ] ]; // @codingStandardsIgnoreEnd Generic.Files.LineLength } }