Merge "Run database-using tests in MySQL STRICT mode"
[lhc/web/wiklou.git] / tests / phpunit / includes / HtmlTest.php
index a01f2f5..85c95e4 100644 (file)
@@ -46,7 +46,7 @@ class HtmlTest extends MediaWikiTestCase {
                $this->assertEquals(
                        '<img/>',
                        Html::element( 'img', null, '' ),
-                       'No close tag for short-tag elements'
+                       'Self-closing tag for short-tag elements'
                );
 
                $this->assertEquals(
@@ -60,12 +60,6 @@ class HtmlTest extends MediaWikiTestCase {
                        Html::element( 'element', [], '' ),
                        'Close tag for empty element (array, string)'
                );
-
-               $this->assertEquals(
-                       '<img/>',
-                       Html::element( 'img', null, '' ),
-                       'Self-closing tag for short-tag elements'
-               );
        }
 
        public function dataXmlMimeType() {
@@ -140,12 +134,6 @@ class HtmlTest extends MediaWikiTestCase {
                        Html::expandAttributes( [ 'selected' ] ),
                        'Boolean attributes have no value when value is true (passed as numerical array)'
                );
-
-               $this->assertEquals(
-                       ' selected=""',
-                       Html::expandAttributes( [ 'selected' => true ] ),
-                       'Boolean attributes have empty string value when value is true'
-               );
        }
 
        /**
@@ -283,7 +271,7 @@ class HtmlTest extends MediaWikiTestCase {
        /**
         * How do we handle duplicate keys in HTML attributes expansion?
         * We could pass a "class" the values: 'GREEN' and array( 'GREEN' => false )
-        * The later will take precedence.
+        * The latter will take precedence.
         *
         * Feature added by r96188
         * @covers Html::expandAttributes
@@ -750,6 +738,16 @@ class HtmlTest extends MediaWikiTestCase {
                                '1x.png 1x, 1_5x.png 1.5x, 2x.png 2x',
                                'pixel depth keys may omit a trailing "x"'
                        ],
+                       [
+                               [ '1'  => 'small.png', '1.5' => 'large.png', '2'  => 'large.png' ],
+                               'small.png 1x, large.png 1.5x',
+                               'omit larger duplicates'
+                       ],
+                       [
+                               [ '1'  => 'small.png', '2'  => 'large.png', '1.5' => 'large.png' ],
+                               'small.png 1x, large.png 1.5x',
+                               'omit larger duplicates in irregular order'
+                       ],
                ];
        }