some html!' ] ]; } /** * @dataProvider provideConstructor */ public function testConstructor( $value ) { $this->assertInstanceOf( HtmlArmor::class, new HtmlArmor( $value ) ); } public static function provideGetHtml() { return [ [ 'foobar', 'foobar', ], [ '', '<script>alert("evil!");</script>', ], [ new HtmlArmor( '' ), '', ], [ new HtmlArmor( null ), null, ] ]; } /** * @dataProvider provideGetHtml */ public function testGetHtml( $input, $expected ) { $this->assertEquals( $expected, HtmlArmor::getHtml( $input ) ); } }