r91994 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91993‎ | r91994 | r91995 >
Date:20:05, 12 July 2011
Author:aaron
Status:ok
Tags:
Comment:
Fixed failing XML tests (on windows) due to newline vs carriage return discrepancy...ugh
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/XmlSelectTest.php (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/XmlTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/XmlTest.php
@@ -100,36 +100,36 @@
101101
102102
103103 $this->assertEquals(
104 - '<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>
105 -<option value="1">January</option>
106 -<option value="2" selected="selected">February</option>
107 -<option value="3">March</option>
108 -<option value="4">April</option>
109 -<option value="5">May</option>
110 -<option value="6">June</option>
111 -<option value="7">July</option>
112 -<option value="8">August</option>
113 -<option value="9">September</option>
114 -<option value="10">October</option>
115 -<option value="11">November</option>
116 -<option value="12">December</option></select>',
 104+ '<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>' . "\n" .
 105+'<option value="1">January</option>' . "\n" .
 106+'<option value="2" selected="selected">February</option>' . "\n" .
 107+'<option value="3">March</option>' . "\n" .
 108+'<option value="4">April</option>' . "\n" .
 109+'<option value="5">May</option>' . "\n" .
 110+'<option value="6">June</option>' . "\n" .
 111+'<option value="7">July</option>' . "\n" .
 112+'<option value="8">August</option>' . "\n" .
 113+'<option value="9">September</option>' . "\n" .
 114+'<option value="10">October</option>' . "\n" .
 115+'<option value="11">November</option>' . "\n" .
 116+'<option value="12">December</option></select>',
117117 Xml::dateMenu( 2011, 02 ),
118118 "Date menu for february 2011"
119119 );
120120 $this->assertEquals(
121 - '<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>
122 -<option value="1">January</option>
123 -<option value="2">February</option>
124 -<option value="3">March</option>
125 -<option value="4">April</option>
126 -<option value="5">May</option>
127 -<option value="6">June</option>
128 -<option value="7">July</option>
129 -<option value="8">August</option>
130 -<option value="9">September</option>
131 -<option value="10">October</option>
132 -<option value="11">November</option>
133 -<option value="12">December</option></select>',
 121+ '<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>' . "\n" .
 122+'<option value="1">January</option>' . "\n" .
 123+'<option value="2">February</option>' . "\n" .
 124+'<option value="3">March</option>' . "\n" .
 125+'<option value="4">April</option>' . "\n" .
 126+'<option value="5">May</option>' . "\n" .
 127+'<option value="6">June</option>' . "\n" .
 128+'<option value="7">July</option>' . "\n" .
 129+'<option value="8">August</option>' . "\n" .
 130+'<option value="9">September</option>' . "\n" .
 131+'<option value="10">October</option>' . "\n" .
 132+'<option value="11">November</option>' . "\n" .
 133+'<option value="12">December</option></select>',
134134 Xml::dateMenu( 2011, -1),
135135 "Date menu with negative month for 'All'"
136136 );
@@ -146,19 +146,19 @@
147147
148148 # @todo FIXME: Please note there is no year there!
149149 $this->assertEquals(
150 - '<label for="year">From year (and earlier):</label> <input name="year" size="4" value="" 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>
151 -<option value="1">January</option>
152 -<option value="2">February</option>
153 -<option value="3">March</option>
154 -<option value="4">April</option>
155 -<option value="5">May</option>
156 -<option value="6">June</option>
157 -<option value="7">July</option>
158 -<option value="8">August</option>
159 -<option value="9">September</option>
160 -<option value="10">October</option>
161 -<option value="11">November</option>
162 -<option value="12">December</option></select>',
 150+ '<label for="year">From year (and earlier):</label> <input name="year" size="4" value="" 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>' . "\n" .
 151+'<option value="1">January</option>' . "\n" .
 152+'<option value="2">February</option>' . "\n" .
 153+'<option value="3">March</option>' . "\n" .
 154+'<option value="4">April</option>' . "\n" .
 155+'<option value="5">May</option>' . "\n" .
 156+'<option value="6">June</option>' . "\n" .
 157+'<option value="7">July</option>' . "\n" .
 158+'<option value="8">August</option>' . "\n" .
 159+'<option value="9">September</option>' . "\n" .
 160+'<option value="10">October</option>' . "\n" .
 161+'<option value="11">November</option>' . "\n" .
 162+'<option value="12">December</option></select>',
163163 Xml::dateMenu( '', ''),
164164 "Date menu with neither year or month"
165165 );
Index: trunk/phase3/tests/phpunit/includes/XmlSelectTest.php
@@ -79,9 +79,9 @@
8080 $this->select->addOption( 'bar1' );
8181 $this->select->addOption( 'foo2' );
8282 $this->assertEquals(
83 -'<select><option value="foo1">foo1</option>
84 -<option value="bar1" selected="selected">bar1</option>
85 -<option value="foo2">foo2</option></select>', $this->select->getHTML() );
 83+'<select><option value="foo1">foo1</option>' . "\n" .
 84+'<option value="bar1" selected="selected">bar1</option>' . "\n" .
 85+'<option value="foo2">foo2</option></select>', $this->select->getHTML() );
8686 }
8787
8888 /**
@@ -95,9 +95,9 @@
9696 $this->select->addOption( 'foo2' );
9797 $this->select->setDefault( 'bar1' ); # setting default after adding options
9898 $this->assertEquals(
99 -'<select><option value="foo1">foo1</option>
100 -<option value="bar1" selected="selected">bar1</option>
101 -<option value="foo2">foo2</option></select>', $this->select->getHTML() );
 99+'<select><option value="foo1">foo1</option>' . "\n" .
 100+'<option value="bar1" selected="selected">bar1</option>' . "\n" .
 101+'<option value="foo2">foo2</option></select>', $this->select->getHTML() );
102102 }
103103
104104 public function testGetAttributes() {

Status & tagging log