Merge "Implement static public Parser::getExternalLinkRel"
[lhc/web/wiklou.git] / tests / phpunit / includes / HtmlTest.php
index 95a6cb0..65dd924 100644 (file)
@@ -73,7 +73,7 @@ class HtmlTest extends MediaWikiTestCase {
        }
 
        public function testExpandAttributesSkipsNullAndFalse() {
-               
+
                ### EMPTY ########
                $this->assertEmpty(
                        Html::expandAttributes( array( 'foo' => null ) ),
@@ -442,7 +442,7 @@ class HtmlTest extends MediaWikiTestCase {
        }
 
        /**
-        * Test out Html::element drops default value
+        * Test out Html::element drops or enforces default value
         * @cover Html::dropDefaults
         * @dataProvider provideElementsWithAttributesHavingDefaultValues
         */
@@ -461,15 +461,12 @@ class HtmlTest extends MediaWikiTestCase {
                        'area', array( 'shape' => 'rect' )
                );
 
-               $cases[] = array( '<button></button>',
+               $cases[] = array( '<button type=submit></button>',
                        'button', array( 'formaction' => 'GET' )
                );
-               $cases[] = array( '<button></button>',
+               $cases[] = array( '<button type=submit></button>',
                        'button', array( 'formenctype' => 'application/x-www-form-urlencoded' )
                );
-               $cases[] = array( '<button></button>',
-                       'button', array( 'type' => 'submit' )
-               );
 
                $cases[] = array( '<canvas></canvas>',
                        'canvas', array( 'height' => '150' )
@@ -560,6 +557,13 @@ class HtmlTest extends MediaWikiTestCase {
                        'input', array( 'type' => 'range', 'value' => '' ),
                );
 
+               # <button> specific handling
+               # see remarks on http://msdn.microsoft.com/en-us/library/ie/ms535211%28v=vs.85%29.aspx
+               $cases[] = array( '<button type=submit></button>',
+                       'button', array( 'type' => 'submit' ),
+                       'According to standard the default type is "submit". Depending on compatibility mode IE might use "button", instead.',
+               );
+
                # <select> specifc handling
                $cases[] = array( '<select multiple></select>',
                        'select', array( 'size' => '4', 'multiple' => true ),