r109974 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109973‎ | r109974 | r109975 >
Date:00:52, 25 January 2012
Author:krinkle
Status:ok (Comments)
Tags:core 
Comment:
[Unit testing] Re-order attribs to a-z to make testing more reliable
* This is in preparation for deprecating this in favor of an Html:: method soon, making sure here that tests still match afterwards
* Follows-up r109698
Modified paths:
  • /trunk/phase3/includes/Xml.php (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/XmlTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/XmlTest.php
@@ -194,7 +194,7 @@
195195
196196 function testNamespaceSelector() {
197197 $this->assertEquals(
198 - '<select id="namespace" name="namespace" class="namespaceselector">
 198+ '<select class="namespaceselector" id="namespace" name="namespace">
199199 <option value="0">(Main)</option>
200200 <option value="1">Talk</option>
201201 <option value="2">User</option>
@@ -214,7 +214,7 @@
215215 'Basic namespace selector without custom options'
216216 );
217217 $this->assertEquals(
218 - '<label for="myname">Select a namespace:</label>&#160;<select id="namespace" name="myname" class="namespaceselector">
 218+ '<label for="myname">Select a namespace:</label>&#160;<select class="namespaceselector" id="namespace" name="myname">
219219 <option value="all">all</option>
220220 <option value="0">(Main)</option>
221221 <option value="1">Talk</option>
Index: trunk/phase3/includes/Xml.php
@@ -143,8 +143,8 @@
144144 $options[] = self::option( $name, $index, $index === $selected );
145145 }
146146
147 - $ret = Xml::openElement( 'select', array( 'id' => 'namespace', 'name' => $element_name,
148 - 'class' => 'namespaceselector' ) )
 147+ $ret = Xml::openElement( 'select', array( 'class' => 'namespaceselector', 'id' => 'namespace',
 148+ 'name' => $element_name ) )
149149 . "\n"
150150 . implode( "\n", $options )
151151 . "\n"

Follow-up revisions

RevisionCommit summaryAuthorDate
r109990[Xml/Html] new method Html::namespaceSelector...krinkle03:01, 25 January 2012
r109993[Html] Unit test + bugfix Html::namespaceSelector...krinkle03:25, 25 January 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r109698[Unit testing] Add unit tests for Xml::namespaceSelector...krinkle22:26, 21 January 2012

Comments

#Comment by MaxSem (talk | contribs)   12:53, 25 January 2012

Not sure if it really matters, but I've always preferred to have id as the first attribute for readability.

Status & tagging log