diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:30:02 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:30:02 -0400 |
commit | 1de335ad3f395ca6861085393ba366a9e3fb4a0d (patch) | |
tree | f1fdd326034e05177596851be6a7127615d81498 /tests/phpunit/includes/HtmlTest.php | |
parent | 9c75fa8ff6d4d38ef552c00fef5969fb154765e8 (diff) | |
parent | f6d65e533c62f6deb21342d4901ece24497b433e (diff) |
Merge commit 'f6d65'
# Conflicts:
# skins/ArchLinux/ArchLinux.php
Diffstat (limited to 'tests/phpunit/includes/HtmlTest.php')
-rw-r--r-- | tests/phpunit/includes/HtmlTest.php | 28 |
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 { |