From: Bartosz DziewoƄski Date: Tue, 6 Jun 2017 13:04:09 +0000 (+0200) Subject: Rename all files used in ResourceLoaderImageModule tests to fake names X-Git-Tag: 1.31.0-rc.0~3040^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%29%20.%20%22?a=commitdiff_plain;h=efd707de3750b4016943243734021701d75074ae;p=lhc%2Fweb%2Fwiklou.git Rename all files used in ResourceLoaderImageModule tests to fake names Using names that match real OOjs UI icons is confusing when trying to find usages of the real icons and when debugging the tests. Bug: T166730 Change-Id: Ibb97c0347476efc95f1a50c97822d7dab19737f2 --- diff --git a/tests/phpunit/data/resourceloader/abc.gif b/tests/phpunit/data/resourceloader/abc.gif new file mode 100644 index 0000000000..5f454ca16c Binary files /dev/null and b/tests/phpunit/data/resourceloader/abc.gif differ diff --git a/tests/phpunit/data/resourceloader/add.gif b/tests/phpunit/data/resourceloader/add.gif deleted file mode 100644 index 5f454ca16c..0000000000 Binary files a/tests/phpunit/data/resourceloader/add.gif and /dev/null differ diff --git a/tests/phpunit/data/resourceloader/bold-a.svg b/tests/phpunit/data/resourceloader/bold-a.svg deleted file mode 100644 index 4b82877979..0000000000 --- a/tests/phpunit/data/resourceloader/bold-a.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/tests/phpunit/data/resourceloader/bold-b.svg b/tests/phpunit/data/resourceloader/bold-b.svg deleted file mode 100644 index 4f64820368..0000000000 --- a/tests/phpunit/data/resourceloader/bold-b.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/tests/phpunit/data/resourceloader/bold-f.svg b/tests/phpunit/data/resourceloader/bold-f.svg deleted file mode 100644 index 357d2e5d34..0000000000 --- a/tests/phpunit/data/resourceloader/bold-f.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/tests/phpunit/data/resourceloader/def.svg b/tests/phpunit/data/resourceloader/def.svg new file mode 100644 index 0000000000..6ad791744e --- /dev/null +++ b/tests/phpunit/data/resourceloader/def.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/tests/phpunit/data/resourceloader/def_variantize.svg b/tests/phpunit/data/resourceloader/def_variantize.svg new file mode 100644 index 0000000000..bcbe87120e --- /dev/null +++ b/tests/phpunit/data/resourceloader/def_variantize.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/tests/phpunit/data/resourceloader/ghi.svg b/tests/phpunit/data/resourceloader/ghi.svg new file mode 100644 index 0000000000..02b4e38798 --- /dev/null +++ b/tests/phpunit/data/resourceloader/ghi.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tests/phpunit/data/resourceloader/ghi_massage.svg b/tests/phpunit/data/resourceloader/ghi_massage.svg new file mode 100644 index 0000000000..bbd1a8d66a --- /dev/null +++ b/tests/phpunit/data/resourceloader/ghi_massage.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tests/phpunit/data/resourceloader/help-ltr.svg b/tests/phpunit/data/resourceloader/help-ltr.svg deleted file mode 100644 index bb2545c58b..0000000000 --- a/tests/phpunit/data/resourceloader/help-ltr.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/tests/phpunit/data/resourceloader/help-rtl.svg b/tests/phpunit/data/resourceloader/help-rtl.svg deleted file mode 100644 index 255ae95b08..0000000000 --- a/tests/phpunit/data/resourceloader/help-rtl.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/tests/phpunit/data/resourceloader/jkl.svg b/tests/phpunit/data/resourceloader/jkl.svg new file mode 100644 index 0000000000..f31ec095c3 --- /dev/null +++ b/tests/phpunit/data/resourceloader/jkl.svg @@ -0,0 +1,4 @@ + + + + diff --git a/tests/phpunit/data/resourceloader/mno-ltr.svg b/tests/phpunit/data/resourceloader/mno-ltr.svg new file mode 100644 index 0000000000..bb2545c58b --- /dev/null +++ b/tests/phpunit/data/resourceloader/mno-ltr.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tests/phpunit/data/resourceloader/mno-rtl.svg b/tests/phpunit/data/resourceloader/mno-rtl.svg new file mode 100644 index 0000000000..255ae95b08 --- /dev/null +++ b/tests/phpunit/data/resourceloader/mno-rtl.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tests/phpunit/data/resourceloader/next.svg b/tests/phpunit/data/resourceloader/next.svg deleted file mode 100644 index 02b4e38798..0000000000 --- a/tests/phpunit/data/resourceloader/next.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/tests/phpunit/data/resourceloader/next_massage.svg b/tests/phpunit/data/resourceloader/next_massage.svg deleted file mode 100644 index bbd1a8d66a..0000000000 --- a/tests/phpunit/data/resourceloader/next_massage.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/tests/phpunit/data/resourceloader/oouiimagemodule/apex/icons.json b/tests/phpunit/data/resourceloader/oouiimagemodule/apex/icons.json index 4fe3d81982..fdb4d127e9 100644 --- a/tests/phpunit/data/resourceloader/oouiimagemodule/apex/icons.json +++ b/tests/phpunit/data/resourceloader/oouiimagemodule/apex/icons.json @@ -1,6 +1,6 @@ { "prefix": "oo-ui-icon", "images": { - "search": { "file": "images/icons/search.svg" } + "stu": { "file": "images/icons/stu.svg" } } } diff --git a/tests/phpunit/data/resourceloader/oouiimagemodule/apex/images/icons/search.svg b/tests/phpunit/data/resourceloader/oouiimagemodule/apex/images/icons/search.svg deleted file mode 100644 index 6952997131..0000000000 --- a/tests/phpunit/data/resourceloader/oouiimagemodule/apex/images/icons/search.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/tests/phpunit/data/resourceloader/oouiimagemodule/apex/images/icons/stu.svg b/tests/phpunit/data/resourceloader/oouiimagemodule/apex/images/icons/stu.svg new file mode 100644 index 0000000000..27f14df16c --- /dev/null +++ b/tests/phpunit/data/resourceloader/oouiimagemodule/apex/images/icons/stu.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/tests/phpunit/data/resourceloader/oouiimagemodule/wikimediaui/icons.json b/tests/phpunit/data/resourceloader/oouiimagemodule/wikimediaui/icons.json index 4fe3d81982..fdb4d127e9 100644 --- a/tests/phpunit/data/resourceloader/oouiimagemodule/wikimediaui/icons.json +++ b/tests/phpunit/data/resourceloader/oouiimagemodule/wikimediaui/icons.json @@ -1,6 +1,6 @@ { "prefix": "oo-ui-icon", "images": { - "search": { "file": "images/icons/search.svg" } + "stu": { "file": "images/icons/stu.svg" } } } diff --git a/tests/phpunit/data/resourceloader/oouiimagemodule/wikimediaui/images/icons/search.svg b/tests/phpunit/data/resourceloader/oouiimagemodule/wikimediaui/images/icons/search.svg deleted file mode 100644 index 40438ea2cf..0000000000 --- a/tests/phpunit/data/resourceloader/oouiimagemodule/wikimediaui/images/icons/search.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/tests/phpunit/data/resourceloader/oouiimagemodule/wikimediaui/images/icons/stu.svg b/tests/phpunit/data/resourceloader/oouiimagemodule/wikimediaui/images/icons/stu.svg new file mode 100644 index 0000000000..fcaaa8d245 --- /dev/null +++ b/tests/phpunit/data/resourceloader/oouiimagemodule/wikimediaui/images/icons/stu.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/tests/phpunit/data/resourceloader/pqr-a.svg b/tests/phpunit/data/resourceloader/pqr-a.svg new file mode 100644 index 0000000000..4b82877979 --- /dev/null +++ b/tests/phpunit/data/resourceloader/pqr-a.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/tests/phpunit/data/resourceloader/pqr-b.svg b/tests/phpunit/data/resourceloader/pqr-b.svg new file mode 100644 index 0000000000..4f64820368 --- /dev/null +++ b/tests/phpunit/data/resourceloader/pqr-b.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/tests/phpunit/data/resourceloader/pqr-f.svg b/tests/phpunit/data/resourceloader/pqr-f.svg new file mode 100644 index 0000000000..357d2e5d34 --- /dev/null +++ b/tests/phpunit/data/resourceloader/pqr-f.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/tests/phpunit/data/resourceloader/prev.svg b/tests/phpunit/data/resourceloader/prev.svg deleted file mode 100644 index f31ec095c3..0000000000 --- a/tests/phpunit/data/resourceloader/prev.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/tests/phpunit/data/resourceloader/remove.svg b/tests/phpunit/data/resourceloader/remove.svg deleted file mode 100644 index 6ad791744e..0000000000 --- a/tests/phpunit/data/resourceloader/remove.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/tests/phpunit/data/resourceloader/remove_variantize.svg b/tests/phpunit/data/resourceloader/remove_variantize.svg deleted file mode 100644 index bcbe87120e..0000000000 --- a/tests/phpunit/data/resourceloader/remove_variantize.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderImageModuleTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderImageModuleTest.php index 0015486bb6..f53cd069c2 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderImageModuleTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderImageModuleTest.php @@ -8,32 +8,32 @@ use Wikimedia\TestingAccessWrapper; class ResourceLoaderImageModuleTest extends ResourceLoaderTestCase { public static $commonImageData = [ - 'add' => 'add.gif', - 'remove' => [ - 'file' => 'remove.svg', + 'abc' => 'abc.gif', + 'def' => [ + 'file' => 'def.svg', 'variants' => [ 'destructive' ], ], - 'next' => [ + 'ghi' => [ 'file' => [ - 'ltr' => 'next.svg', - 'rtl' => 'prev.svg' + 'ltr' => 'ghi.svg', + 'rtl' => 'jkl.svg' ], ], - 'help' => [ + 'mno' => [ 'file' => [ - 'ltr' => 'help-ltr.svg', - 'rtl' => 'help-rtl.svg', + 'ltr' => 'mno-ltr.svg', + 'rtl' => 'mno-rtl.svg', 'lang' => [ - 'he' => 'help-ltr.svg', + 'he' => 'mno-ltr.svg', ] ], ], - 'bold' => [ + 'pqr' => [ 'file' => [ - 'default' => 'bold-a.svg', + 'default' => 'pqr-a.svg', 'lang' => [ - 'en' => 'bold-b.svg', - 'ar,de' => 'bold-f.svg', + 'en' => 'pqr-b.svg', + 'ar,de' => 'pqr-f.svg', ] ], ] @@ -64,37 +64,37 @@ class ResourceLoaderImageModuleTest extends ResourceLoaderTestCase { 'variants' => self::$commonImageVariants, 'images' => self::$commonImageData, ], - '.oo-ui-icon-add { + '.oo-ui-icon-abc { ... } -.oo-ui-icon-add-invert { +.oo-ui-icon-abc-invert { ... } -.oo-ui-icon-remove { +.oo-ui-icon-def { ... } -.oo-ui-icon-remove-invert { +.oo-ui-icon-def-invert { ... } -.oo-ui-icon-remove-destructive { +.oo-ui-icon-def-destructive { ... } -.oo-ui-icon-next { +.oo-ui-icon-ghi { ... } -.oo-ui-icon-next-invert { +.oo-ui-icon-ghi-invert { ... } -.oo-ui-icon-help { +.oo-ui-icon-mno { ... } -.oo-ui-icon-help-invert { +.oo-ui-icon-mno-invert { ... } -.oo-ui-icon-bold { +.oo-ui-icon-pqr { ... } -.oo-ui-icon-bold-invert { +.oo-ui-icon-pqr-invert { ... }', ], @@ -107,37 +107,37 @@ class ResourceLoaderImageModuleTest extends ResourceLoaderTestCase { 'variants' => self::$commonImageVariants, 'images' => self::$commonImageData, ], - '.mw-ui-icon-add:after, .mw-ui-icon-add:before { + '.mw-ui-icon-abc:after, .mw-ui-icon-abc:before { ... } -.mw-ui-icon-add-invert:after, .mw-ui-icon-add-invert:before { +.mw-ui-icon-abc-invert:after, .mw-ui-icon-abc-invert:before { ... } -.mw-ui-icon-remove:after, .mw-ui-icon-remove:before { +.mw-ui-icon-def:after, .mw-ui-icon-def:before { ... } -.mw-ui-icon-remove-invert:after, .mw-ui-icon-remove-invert:before { +.mw-ui-icon-def-invert:after, .mw-ui-icon-def-invert:before { ... } -.mw-ui-icon-remove-destructive:after, .mw-ui-icon-remove-destructive:before { +.mw-ui-icon-def-destructive:after, .mw-ui-icon-def-destructive:before { ... } -.mw-ui-icon-next:after, .mw-ui-icon-next:before { +.mw-ui-icon-ghi:after, .mw-ui-icon-ghi:before { ... } -.mw-ui-icon-next-invert:after, .mw-ui-icon-next-invert:before { +.mw-ui-icon-ghi-invert:after, .mw-ui-icon-ghi-invert:before { ... } -.mw-ui-icon-help:after, .mw-ui-icon-help:before { +.mw-ui-icon-mno:after, .mw-ui-icon-mno:before { ... } -.mw-ui-icon-help-invert:after, .mw-ui-icon-help-invert:before { +.mw-ui-icon-mno-invert:after, .mw-ui-icon-mno-invert:before { ... } -.mw-ui-icon-bold:after, .mw-ui-icon-bold:before { +.mw-ui-icon-pqr:after, .mw-ui-icon-pqr:before { ... } -.mw-ui-icon-bold-invert:after, .mw-ui-icon-bold-invert:before { +.mw-ui-icon-pqr-invert:after, .mw-ui-icon-pqr-invert:before { ... }', ], diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderImageTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderImageTest.php index 84b56d4f11..aea2776463 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderImageTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderImageTest.php @@ -29,20 +29,20 @@ class ResourceLoaderImageTest extends ResourceLoaderTestCase { public static function provideGetPath() { return [ - [ 'add', 'en', 'add.gif' ], - [ 'add', 'he', 'add.gif' ], - [ 'remove', 'en', 'remove.svg' ], - [ 'remove', 'he', 'remove.svg' ], - [ 'next', 'en', 'next.svg' ], - [ 'next', 'he', 'prev.svg' ], - [ 'help', 'en', 'help-ltr.svg' ], - [ 'help', 'ar', 'help-rtl.svg' ], - [ 'help', 'he', 'help-ltr.svg' ], - [ 'bold', 'en', 'bold-b.svg' ], - [ 'bold', 'de', 'bold-f.svg' ], - [ 'bold', 'ar', 'bold-f.svg' ], - [ 'bold', 'fr', 'bold-a.svg' ], - [ 'bold', 'he', 'bold-a.svg' ], + [ 'abc', 'en', 'abc.gif' ], + [ 'abc', 'he', 'abc.gif' ], + [ 'def', 'en', 'def.svg' ], + [ 'def', 'he', 'def.svg' ], + [ 'ghi', 'en', 'ghi.svg' ], + [ 'ghi', 'he', 'jkl.svg' ], + [ 'mno', 'en', 'mno-ltr.svg' ], + [ 'mno', 'ar', 'mno-rtl.svg' ], + [ 'mno', 'he', 'mno-ltr.svg' ], + [ 'pqr', 'en', 'pqr-b.svg' ], + [ 'pqr', 'de', 'pqr-f.svg' ], + [ 'pqr', 'ar', 'pqr-f.svg' ], + [ 'pqr', 'fr', 'pqr-a.svg' ], + [ 'pqr', 'he', 'pqr-a.svg' ], ]; } @@ -74,11 +74,11 @@ class ResourceLoaderImageTest extends ResourceLoaderTestCase { * @covers ResourceLoaderImage::getMimeType */ public function testGetExtension() { - $image = $this->getTestImage( 'remove' ); + $image = $this->getTestImage( 'def' ); $this->assertEquals( $image->getExtension(), 'svg' ); $this->assertEquals( $image->getExtension( 'original' ), 'svg' ); $this->assertEquals( $image->getExtension( 'rasterized' ), 'png' ); - $image = $this->getTestImage( 'add' ); + $image = $this->getTestImage( 'abc' ); $this->assertEquals( $image->getExtension(), 'gif' ); $this->assertEquals( $image->getExtension( 'original' ), 'gif' ); $this->assertEquals( $image->getExtension( 'rasterized' ), 'gif' ); @@ -92,9 +92,9 @@ class ResourceLoaderImageTest extends ResourceLoaderTestCase { public function testGetImageData() { $context = $this->getResourceLoaderContext(); - $image = $this->getTestImage( 'remove' ); - $data = file_get_contents( $this->imagesPath . '/remove.svg' ); - $dataConstructive = file_get_contents( $this->imagesPath . '/remove_variantize.svg' ); + $image = $this->getTestImage( 'def' ); + $data = file_get_contents( $this->imagesPath . '/def.svg' ); + $dataConstructive = file_get_contents( $this->imagesPath . '/def_variantize.svg' ); $this->assertEquals( $image->getImageData( $context, null, 'original' ), $data ); $this->assertEquals( $image->getImageData( $context, 'destructive', 'original' ), @@ -103,8 +103,8 @@ class ResourceLoaderImageTest extends ResourceLoaderTestCase { // Stub, since we don't know if we even have a SVG handler, much less what exactly it'll output $this->assertEquals( $image->getImageData( $context, null, 'rasterized' ), 'RASTERIZESTUB' ); - $image = $this->getTestImage( 'add' ); - $data = file_get_contents( $this->imagesPath . '/add.gif' ); + $image = $this->getTestImage( 'abc' ); + $data = file_get_contents( $this->imagesPath . '/abc.gif' ); $this->assertEquals( $image->getImageData( $context, null, 'original' ), $data ); $this->assertEquals( $image->getImageData( $context, null, 'rasterized' ), $data ); } @@ -113,9 +113,9 @@ class ResourceLoaderImageTest extends ResourceLoaderTestCase { * @covers ResourceLoaderImage::massageSvgPathdata */ public function testMassageSvgPathdata() { - $image = $this->getTestImage( 'next' ); - $data = file_get_contents( $this->imagesPath . '/next.svg' ); - $dataMassaged = file_get_contents( $this->imagesPath . '/next_massage.svg' ); + $image = $this->getTestImage( 'ghi' ); + $data = file_get_contents( $this->imagesPath . '/ghi.svg' ); + $dataMassaged = file_get_contents( $this->imagesPath . '/ghi_massage.svg' ); $this->assertEquals( $image->massageSvgPathdata( $data ), $dataMassaged ); } } diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderOOUIImageModuleTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderOOUIImageModuleTest.php index 4e482c8933..491fff6b1c 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderOOUIImageModuleTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderOOUIImageModuleTest.php @@ -39,7 +39,7 @@ class ResourceLoaderOOUIImageModuleTest extends ResourceLoaderTestCase { $styles = $module->getStyles( $this->getResourceLoaderContext( [ 'skin' => 'fakemonobook' ] ) ); $this->assertRegExp( - '/magnifying-glass-apex/', + '/stu-apex/', $styles['all'], 'Generated styles use the non-default image (embed)' ); @@ -51,7 +51,7 @@ class ResourceLoaderOOUIImageModuleTest extends ResourceLoaderTestCase { $styles = $module->getStyles( $this->getResourceLoaderContext() ); $this->assertRegExp( - '/magnifying-glass-mediawiki/', + '/stu-wikimediaui/', $styles['all'], 'Generated styles use the default image (embed)' );