r76238 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76237‎ | r76238 | r76239 >
Date:10:06, 7 November 2010
Author:hashar
Status:deferred
Tags:
Comment:
Xml::label() tests. Follow up r63675.
Modified paths:
  • /trunk/phase3/maintenance/tests/phpunit/includes/XmlTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/tests/phpunit/includes/XmlTest.php
@@ -93,6 +93,39 @@
9494 }
9595
9696 #
 97+ # input and label
 98+ #
 99+ function testLabelCreation() {
 100+ $this->assertEquals(
 101+ '<label for="id">name</label>',
 102+ Xml::label( 'name', 'id' ),
 103+ 'label() with no attribs'
 104+ );
 105+ }
 106+ function testLabelAttributeCanOnlyBeClass() {
 107+ $this->assertEquals(
 108+ '<label for="id">name</label>',
 109+ Xml::label( 'name', 'id', array( 'generated' => true ) ),
 110+ 'label() can not be given a generated attribute'
 111+ );
 112+ $this->assertEquals(
 113+ '<label for="id" class="nice">name</label>',
 114+ Xml::label( 'name', 'id', array( 'class' => 'nice' ) ),
 115+ 'label() can get a class attribute'
 116+ );
 117+ $this->assertEquals(
 118+ '<label for="id" class="nice">name</label>',
 119+ Xml::label( 'name', 'id', array(
 120+ 'generated' => true,
 121+ 'class' => 'nice',
 122+ 'anotherattr' => 'value',
 123+ )
 124+ ),
 125+ 'label() skip all attributes but "class"'
 126+ );
 127+ }
 128+
 129+ #
97130 # JS
98131 #
99132 function testEscapeJsStringSpecialChars() {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r63675Apply CSS classes for XML checkboxes/radiobuttons to their labels as well.happy-melon14:59, 13 March 2010

Status & tagging log