setupFile = dirname( __FILE__ ) . '/../../PortableInfobox.setup.php'; $this->sanitizer = SanitizerBuilder::createFromType('image'); parent::setUp(); } /** * @param $data * @param $expected * @dataProvider testSanitizeDataProvider */ function testSanitize( $data, $expected ) { $this->assertEquals( $expected, $this->sanitizer->sanitize( $data ) ); } function testSanitizeDataProvider() { return [ [ [ 'caption' => 'Test Title with small tag, span tag and tag' ], [ 'caption' => 'Test Title with small tag, span tag and tag' ] ], [ [ 'caption' => 'All Stats +2' ], [ 'caption' => '' ], ], [ [ 'caption' => '
AMERICA'S TEST KITCHEN SEASON 901:00

AMERICA'S TEST KITCHEN SEASON 9

' ], [ 'caption' => 'AMERICA'S TEST KITCHEN SEASON 9' ] ], [ [ 'caption' => '[1]' ], [ 'caption' => '[1]' ] ], [ [ 'caption' => '' ], [ 'caption' => '' ] ], [ [ 'caption' => '' ], [ 'caption' => '1 2 3' ] ], [ [ 'caption' => '
  1. 1
  2. 2
    1. 2.1
' ], [ 'caption' => '1 2 2.1' ] ], [ [ 'caption' => 'Próxima' ], [ 'caption' => 'Próxima' ] ], [ [ 'caption' => 'Música de' ], [ 'caption' => 'Música de' ] ], [ [ 'caption' => 'A Kuruma in Grand Theft Auto Online.' ], [ 'caption' => 'A Kuruma in Grand Theft Auto Online.' ] ], [ [ 'caption' => 'Idradm (talk) 15:34, January 4, 2016 (UTC)' ], [ 'caption' => 'Idradm (talk) 15:34, January 4, 2016 (UTC)' ] ] ]; } }