', '<abc>'], ['alert(":-)");', 'alert(":-)");'], ['alert(\':-)\');', 'alert(':-)');'], ]; } /** * @dataProvider encodeProvider */ public function testEncode($string, $expected) { $this->assertSame($expected, HtmlHelper::encode($string)); } public function startTagTypeErrorProvider() { return [ [1, []], [false, []], ['tag', true], ['tag', 'attr'], ]; } /** * @dataProvider startTagTypeErrorProvider * @expectedException \TypeError */ public function testStartTagTypeError($name, $attributes) { HtmlHelper::startTag($name, $attributes); } public function startTagProvider() { return [ ['tag', [], ''], ['start', ['a' => '1'], ''], ['start', ['a' => 1], ''], ['start', ['a' => '1', 'b' => '2'], ''], ['start', ['b' => '1', 'a' => '2'], ''], ['start', ['a' => null, 'b' => '2'], ''], ['start', ['a' => true], ''], ['start', ['a' => true, 'b' => '2'], ''], ['start', ['a' => false], ''], ['start', ['a' => false, 'b' => '2'], ''], ['script', ['type' => 'text/javascript'], '