Index: trunk/phase3/tests/phpunit/includes/XmlTest.php |
— | — | @@ -73,6 +73,43 @@ |
74 | 74 | $this->assertEquals( '</element>', Xml::closeElement( 'element' ), 'closeElement() shortcut' ); |
75 | 75 | } |
76 | 76 | |
| 77 | + public function testDateMenu( ) { |
| 78 | + $this->assertEquals( |
| 79 | + '<label for="year">From year (and earlier):</label> <input name="year" size="4" value="2011" id="year" maxlength="4" /> <label for="month">From month (and earlier):</label> <select id="month" name="month" class="mw-month-selector"><option value="-1">all</option> |
| 80 | +<option value="1">January</option> |
| 81 | +<option value="2" selected="selected">February</option> |
| 82 | +<option value="3">March</option> |
| 83 | +<option value="4">April</option> |
| 84 | +<option value="5">May</option> |
| 85 | +<option value="6">June</option> |
| 86 | +<option value="7">July</option> |
| 87 | +<option value="8">August</option> |
| 88 | +<option value="9">September</option> |
| 89 | +<option value="10">October</option> |
| 90 | +<option value="11">November</option> |
| 91 | +<option value="12">December</option></select>', |
| 92 | + Xml::dateMenu( 2011, 02 ), |
| 93 | + "Date menu for february 2011" |
| 94 | + ); |
| 95 | + $this->assertEquals( |
| 96 | + '<label for="year">From year (and earlier):</label> <input name="year" size="4" value="2011" id="year" maxlength="4" /> <label for="month">From month (and earlier):</label> <select id="month" name="month" class="mw-month-selector"><option value="-1">all</option> |
| 97 | +<option value="1">January</option> |
| 98 | +<option value="2">February</option> |
| 99 | +<option value="3">March</option> |
| 100 | +<option value="4">April</option> |
| 101 | +<option value="5">May</option> |
| 102 | +<option value="6">June</option> |
| 103 | +<option value="7">July</option> |
| 104 | +<option value="8">August</option> |
| 105 | +<option value="9">September</option> |
| 106 | +<option value="10">October</option> |
| 107 | +<option value="11">November</option> |
| 108 | +<option value="12">December</option></select>', |
| 109 | + Xml::dateMenu( 2011, -1), |
| 110 | + "Date menu with negative month for 'All'" |
| 111 | + ); |
| 112 | + } |
| 113 | + |
77 | 114 | # |
78 | 115 | # textarea |
79 | 116 | # |