setupFile = dirname( __FILE__ ) . '/../../PortableInfobox.setup.php';
$this->sanitizer = SanitizerBuilder::createFromType('hero-mobile');
parent::setUp();
}
/**
* @param $data
* @param $expected
* @dataProvider testSanitizeDataProvider
*/
function testSanitize( $data, $expected ) {
$this->assertEquals(
$expected,
$this->sanitizer->sanitize( $data )
);
}
function testSanitizeDataProvider() {
return [
[
[ 'title' => [ 'value' => 'Test Title' ] ],
[ 'title' => [ 'value' => 'Test Title' ] ]
],
[
[ 'title' => [ 'value' => 'Real world title example' ] ] ,
[ 'title' => [ 'value' => 'Real world title example' ] ]
],
[
[ 'title' => [ 'value' => 'Test Title with small tag, span tag and tag' ] ],
[ 'title' => [ 'value' => 'Test Title with small tag, span tag and tag' ] ]
],
[
[ 'title' => [ 'value' => '' ] ],
[ 'title' => [ 'value' => '' ] ],
],
[
[ 'title' => [ 'value' => '' ] ],
[ 'title' => [ 'value' => 'AMERICA'S TEST KITCHEN SEASON 9' ] ]
],
[
[ 'title' => [ 'value' => '[1]' ] ],
[ 'title' => [ 'value' => '[1]' ] ]
],
[
[ 'title' => [ 'value' => '' ] ],
[ 'title' => [ 'value' => '' ] ]
],
[
[ 'title' => [ 'value' => '
' ] ],
[ 'title' => [ 'value' => '1 2 3' ] ]
],
[
[ 'title' => [ 'value' => '- 1
- 2
- 2.1
' ] ],
[ 'title' => [ 'value' => '1 2 2.1' ] ]
],
[
[ 'title' => [ 'value' => 'Próxima' ] ],
[ 'title' => [ 'value' => 'Próxima' ] ]
],
[
[ 'title' => [ 'value' => 'Música de' ] ],
[ 'title' => [ 'value' => 'Música de' ] ]
],
[
[ 'title' => [ 'value' => 'A Kuruma in Grand Theft Auto Online.' ] ],
[ 'title' => [ 'value' => 'A Kuruma in Grand Theft Auto Online.' ] ]
],
[
[ 'title' => [ 'value' => 'Idradm (talk) 15:34, January 4, 2016 (UTC)' ] ],
[ 'title' => [ 'value' => 'Idradm (talk) 15:34, January 4, 2016 (UTC)' ] ]
],
[
[ 'image' => [ 'caption' => 'Test Title' ] ],
[ 'image' => [ 'caption' => 'Test Title' ] ]
],
[
[ 'image' => [ 'caption' => 'Real world title example' ] ] ,
[ 'image' => [ 'caption' => 'Real world title example' ] ]
],
[
[ 'image' => [ 'caption' => 'Test Title with small tag, span tag and tag' ] ],
[ 'image' => [ 'caption' => 'Test Title with small tag, span tag and tag' ] ]
],
[
[ 'image' => [ 'caption' => '' ] ],
[ 'image' => [ 'caption' => '' ] ],
],
[
[ 'image' => [ 'caption' => '' ] ],
[ 'image' => [ 'caption' => 'AMERICA'S TEST KITCHEN SEASON 9' ] ]
],
[
[ 'image' => [ 'caption' => '[1]' ] ],
[ 'image' => [ 'caption' => '[1]' ] ]
],
[
[ 'image' => [ 'caption' => '' ] ],
[ 'image' => [ 'caption' => '' ] ]
],
[
[ 'image' => [ 'caption' => '' ] ],
[ 'image' => [ 'caption' => '1 2 3' ] ]
],
[
[ 'image' => [ 'caption' => '- 1
- 2
- 2.1
' ] ],
[ 'image' => [ 'caption' => '1 2 2.1' ] ]
],
[
[ 'image' => [ 'caption' => 'Próxima' ] ],
[ 'image' => [ 'caption' => 'Próxima' ] ]
],
[
[ 'image' => [ 'caption' => 'Música de' ] ],
[ 'image' => [ 'caption' => 'Música de' ] ]
],
[
[ 'image' => [ 'caption' => 'A Kuruma in Grand Theft Auto Online.' ] ],
[ 'image' => [ 'caption' => 'A Kuruma in Grand Theft Auto Online.' ] ]
],
[
[ 'image' => [ 'caption' => 'Idradm (talk) 15:34, January 4, 2016 (UTC)' ] ],
[ 'image' => [ 'caption' => 'Idradm (talk) 15:34, January 4, 2016 (UTC)' ] ]
]
];
}
}