summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/HtmlTest.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-06-04 07:31:04 +0200
committerPierre Schmitz <pierre@archlinux.de>2015-06-04 07:58:39 +0200
commitf6d65e533c62f6deb21342d4901ece24497b433e (patch)
treef28adf0362d14bcd448f7b65a7aaf38650f923aa /tests/phpunit/includes/HtmlTest.php
parentc27b2e832fe25651ef2410fae85b41072aae7519 (diff)
Update to MediaWiki 1.25.1
Diffstat (limited to 'tests/phpunit/includes/HtmlTest.php')
-rw-r--r--tests/phpunit/includes/HtmlTest.php28
1 files changed, 26 insertions, 2 deletions
diff --git a/tests/phpunit/includes/HtmlTest.php b/tests/phpunit/includes/HtmlTest.php
index a8829cd8..c5797c4f 100644
--- a/tests/phpunit/includes/HtmlTest.php
+++ b/tests/phpunit/includes/HtmlTest.php
@@ -637,7 +637,7 @@ class HtmlTest extends MediaWikiTestCase {
. 'Depending on compatibility mode IE might use "button", instead.',
);
- # <select> specifc handling
+ # <select> specific handling
$cases[] = array( '<select multiple></select>',
'select', array( 'size' => '4', 'multiple' => true ),
);
@@ -715,7 +715,7 @@ class HtmlTest extends MediaWikiTestCase {
'Input wrapper with type and value.'
);
$this->assertEquals(
- '<input name=testname class=mw-ui-input>',
+ '<input name=testname>',
Html::input( 'testname' ),
'Input wrapper with all default values.'
);
@@ -764,6 +764,30 @@ class HtmlTest extends MediaWikiTestCase {
'Label wrapper'
);
}
+
+ public static function provideSrcSetImages() {
+ return array(
+ array( array(), '', 'when there are no images, return empty string' ),
+ array(
+ array( '1x' => '1x.png', '1.5x' => '1_5x.png', '2x' => '2x.png' ),
+ '1x.png 1x, 1_5x.png 1.5x, 2x.png 2x',
+ 'pixel depth keys may include a trailing "x"'
+ ),
+ array(
+ array( '1' => '1x.png', '1.5' => '1_5x.png', '2' => '2x.png' ),
+ '1x.png 1x, 1_5x.png 1.5x, 2x.png 2x',
+ 'pixel depth keys may omit a trailing "x"'
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider provideSrcSetImages
+ * @covers Html::srcSet
+ */
+ public function testSrcSet( $images, $expected, $message ) {
+ $this->assertEquals( Html::srcSet( $images ), $expected, $message );
+ }
}
class HtmlTestValue {