mirror of
https://github.com/Universal-Omega/PortableInfobox.git
synced 2024-11-16 12:35:31 +00:00
34 lines
850 B
PHP
34 lines
850 B
PHP
|
<?php
|
||
|
|
||
|
class ImageFilenameSanitizerTest extends WikiaBaseTest {
|
||
|
private $imageFilenameSanitizer;
|
||
|
|
||
|
protected function setUp() {
|
||
|
$this->setupFile = dirname( __FILE__ ) . '/../PortableInfobox.setup.php';
|
||
|
parent::setUp();
|
||
|
|
||
|
$this->imageFilenameSanitizer = \Wikia\PortableInfobox\Helpers\ImageFilenameSanitizer::getInstance();
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @param $inputFileName
|
||
|
* @param $expectedOutput
|
||
|
* @param $description
|
||
|
* @dataProvider testSanitizeFilenameDataProvider
|
||
|
*/
|
||
|
public function testSanitizeFilename( $inputFileName, $expectedOutput, $description ) {
|
||
|
$actualOutput = $this->imageFilenameSanitizer->sanitizeImageFileName( $inputFileName );
|
||
|
|
||
|
$this->assertEquals( $expectedOutput, $actualOutput, $description );
|
||
|
}
|
||
|
|
||
|
public function testSanitizeFilenameDataProvider() {
|
||
|
return [
|
||
|
[
|
||
|
'filename.jpg',
|
||
|
'filename.jpg'
|
||
|
]
|
||
|
];
|
||
|
}
|
||
|
}
|