Index: trunk/phase3/tests/phpunit/includes/IPTest.php |
— | — | @@ -6,7 +6,6 @@ |
7 | 7 | class IPTest extends MediaWikiTestCase { |
8 | 8 | /** |
9 | 9 | * not sure it should be tested with boolean false. hashar 20100924 |
10 | | - * @covers IP:isIPAddress() |
11 | 10 | */ |
12 | 11 | public function testisIPAddress() { |
13 | 12 | $this->assertFalse( IP::isIPAddress( false ), 'Boolean false is not an IP' ); |
— | — | @@ -35,9 +34,6 @@ |
36 | 35 | } |
37 | 36 | } |
38 | 37 | |
39 | | - /** |
40 | | - * @covers IP::isIPv6() |
41 | | - */ |
42 | 38 | public function testisIPv6() { |
43 | 39 | $this->assertFalse( IP::isIPv6( ':fc:100::' ), 'IPv6 starting with lone ":"' ); |
44 | 40 | $this->assertFalse( IP::isIPv6( 'fc:100:::' ), 'IPv6 ending with a ":::"' ); |
— | — | @@ -81,9 +77,6 @@ |
82 | 78 | $this->assertTrue( IP::isIPv6( 'fc:100:a:d:1:e:ac:0' ) ); |
83 | 79 | } |
84 | 80 | |
85 | | - /** |
86 | | - * @covers IP::isIPv4() |
87 | | - */ |
88 | 81 | public function testisIPv4() { |
89 | 82 | $this->assertFalse( IP::isIPv4( false ), 'Boolean false is not an IP' ); |
90 | 83 | $this->assertFalse( IP::isIPv4( true ), 'Boolean true is not an IP' ); |
— | — | @@ -99,9 +92,6 @@ |
100 | 93 | $this->assertTrue( IP::isIPv4( '74.24.52.13/20', 'IPv4 range' ) ); |
101 | 94 | } |
102 | 95 | |
103 | | - /** |
104 | | - * @covers IP::isValid() |
105 | | - */ |
106 | 96 | public function testValidIPs() { |
107 | 97 | foreach ( range( 0, 255 ) as $i ) { |
108 | 98 | $a = sprintf( "%03d", $i ); |
— | — | @@ -123,9 +113,6 @@ |
124 | 114 | } |
125 | 115 | } |
126 | 116 | |
127 | | - /** |
128 | | - * @covers IP::isValid() |
129 | | - */ |
130 | 117 | public function testInvalidIPs() { |
131 | 118 | // Out of range... |
132 | 119 | foreach ( range( 256, 999 ) as $i ) { |
— | — | @@ -173,9 +160,6 @@ |
174 | 161 | } |
175 | 162 | } |
176 | 163 | |
177 | | - /** |
178 | | - * @covers IP::isValidBlock() |
179 | | - */ |
180 | 164 | public function testValidBlocks() { |
181 | 165 | $valid = array( |
182 | 166 | '116.17.184.5/32', |
— | — | @@ -196,9 +180,6 @@ |
197 | 181 | } |
198 | 182 | } |
199 | 183 | |
200 | | - /** |
201 | | - * @covers IP::isValidBlock() |
202 | | - */ |
203 | 184 | public function testInvalidBlocks() { |
204 | 185 | $invalid = array( |
205 | 186 | '116.17.184.5/33', |
— | — | @@ -221,7 +202,6 @@ |
222 | 203 | |
223 | 204 | /** |
224 | 205 | * test wrapper around ip2long which might return -1 or false depending on PHP version |
225 | | - * @covers IP::toUnsigned() |
226 | 206 | */ |
227 | 207 | public function testip2longWrapper() { |
228 | 208 | // fixme : add more tests ? |
— | — | @@ -230,9 +210,6 @@ |
231 | 211 | $this->assertFalse( IP::toUnSigned( $i ) ); |
232 | 212 | } |
233 | 213 | |
234 | | - /** |
235 | | - * @covers IP::isPublic() |
236 | | - */ |
237 | 214 | public function testPrivateIPs() { |
238 | 215 | $private = array( 'fc::3', 'fc::ff', '::1', '10.0.0.1', '172.16.0.1', '192.168.0.1' ); |
239 | 216 | foreach ( $private as $p ) { |
— | — | @@ -252,9 +229,6 @@ |
253 | 230 | $this->assertEquals( $expected, long2ip( $parse[0] ), "network shifting $CIDR" ); |
254 | 231 | } |
255 | 232 | |
256 | | - /** |
257 | | - * @covers IP::hexToQuad() |
258 | | - */ |
259 | 233 | public function testHexToQuad() { |
260 | 234 | $this->assertEquals( '0.0.0.1' , IP::hexToQuad( '00000001' ) ); |
261 | 235 | $this->assertEquals( '255.0.0.0' , IP::hexToQuad( 'FF000000' ) ); |
— | — | @@ -267,9 +241,6 @@ |
268 | 242 | $this->assertEquals( '0.0.255.0' , IP::hexToQuad( 'FF00' ) ); |
269 | 243 | } |
270 | 244 | |
271 | | - /** |
272 | | - * @covers IP::hexToOctet() |
273 | | - */ |
274 | 245 | public function testHexToOctet() { |
275 | 246 | $this->assertEquals( '0:0:0:0:0:0:0:1', |
276 | 247 | IP::hexToOctet( '00000000000000000000000000000001' ) ); |
— | — | @@ -293,7 +264,6 @@ |
294 | 265 | /* |
295 | 266 | * IP::parseCIDR() returns an array containing a signed IP address |
296 | 267 | * representing the network mask and the bit mask. |
297 | | - * @covers IP::parseCIDR() |
298 | 268 | */ |
299 | 269 | function testCIDRParsing() { |
300 | 270 | $this->assertFalseCIDR( '192.0.2.0' , "missing mask" ); |
Index: trunk/phase3/tests/phpunit/phpunit.php |
— | — | @@ -14,14 +14,18 @@ |
15 | 15 | // Set a flag which can be used to detect when other scripts have been entered through this entry point or not |
16 | 16 | define( 'MW_PHPUNIT_TEST', true ); |
17 | 17 | |
18 | | -$options = array( 'quiet' ); |
19 | | - |
20 | 18 | // Start up MediaWiki in command-line mode |
21 | 19 | require_once( "$IP/maintenance/commandLine.inc" ); |
22 | 20 | |
23 | 21 | // Assume UTC for testing purposes |
24 | 22 | $wgLocaltimezone = 'UTC'; |
25 | 23 | |
| 24 | +if( !in_array( '--configuration', $_SERVER['argv'] ) ) { |
| 25 | + //Hack to eliminate the need to use the Makefile (which sucks ATM) |
| 26 | + $_SERVER['argv'][] = '--configuration'; |
| 27 | + $_SERVER['argv'][] = $IP . '/tests/phpunit/suite.xml'; |
| 28 | +} |
| 29 | + |
26 | 30 | require_once( 'PHPUnit/Runner/Version.php' ); |
27 | 31 | if( version_compare( PHPUnit_Runner_Version::id(), '3.5.0', '>=' ) ) { |
28 | 32 | # PHPUnit 3.5.0 introduced a nice autoloader based on class name |