/**
* @group ResourceLoader
+ * @covers ResourceLoaderImage
*/
class ResourceLoaderImageTest extends MediaWikiUnitTestCase {
$this->imagesPath = __DIR__ . '/../../../data/resourceloader';
}
- protected function tearDown() {
- Language::$dataCache = null;
- }
-
protected function getTestImage( $name ) {
$options = ResourceLoaderImageModuleTest::$commonImageData[$name];
$fileDescriptor = is_string( $options ) ? $options : $options['file'];
}
/**
- * @covers ResourceLoaderImage::getPath
* @dataProvider provideGetPath
*/
public function testGetPath( $imageName, $languageCode, $path ) {
+ $this->markTestSkipped( 'Depends on overriding LanguageFallback/LocalisationCache' );
static $dirMap = [
'en' => 'ltr',
'en-gb' => 'ltr',
$this->assertEquals( $image->getPath( $context ), $this->imagesPath . '/' . $path );
}
- /**
- * @covers ResourceLoaderImage::getExtension
- * @covers ResourceLoaderImage::getMimeType
- */
public function testGetExtension() {
$image = $this->getTestImage( 'def' );
$this->assertEquals( $image->getExtension(), 'svg' );
$this->assertEquals( $image->getExtension( 'rasterized' ), 'gif' );
}
- /**
- * @covers ResourceLoaderImage::getImageData
- * @covers ResourceLoaderImage::variantize
- * @covers ResourceLoaderImage::massageSvgPathdata
- */
public function testGetImageData() {
$context = $this->createMock( ResourceLoaderContext::class );
$this->assertEquals( $image->getImageData( $context, null, 'rasterized' ), $data );
}
- /**
- * @covers ResourceLoaderImage::massageSvgPathdata
- */
public function testMassageSvgPathdata() {
$image = $this->getTestImage( 'ghi' );
$data = file_get_contents( $this->imagesPath . '/ghi.svg' );