summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-12-18 06:04:58 +0100
committerPierre Schmitz <pierre@archlinux.de>2015-12-18 06:04:58 +0100
commit257401d8b2cf661adf36c84b0e3fd1cf85e33c22 (patch)
treef8c25e7fa0c2ba18f27c52415c19cb579a316178 /tests/phpunit/includes
parenta1789ddde42033f1b05cc4929491214ee6e79383 (diff)
Update to MediaWiki 1.26.1
Diffstat (limited to 'tests/phpunit/includes')
-rw-r--r--tests/phpunit/includes/parser/MediaWikiParserTest.php1
-rw-r--r--tests/phpunit/includes/parser/NewParserTest.php1
-rw-r--r--tests/phpunit/includes/utils/IPTest.php33
3 files changed, 30 insertions, 5 deletions
diff --git a/tests/phpunit/includes/parser/MediaWikiParserTest.php b/tests/phpunit/includes/parser/MediaWikiParserTest.php
index 96ae3bec..210c17c5 100644
--- a/tests/phpunit/includes/parser/MediaWikiParserTest.php
+++ b/tests/phpunit/includes/parser/MediaWikiParserTest.php
@@ -7,6 +7,7 @@ require_once __DIR__ . '/NewParserTest.php';
* an PHPUnit_Framework_Test object
*
* @group Parser
+ * @group ParserTests
* @group Database
*/
class MediaWikiParserTest {
diff --git a/tests/phpunit/includes/parser/NewParserTest.php b/tests/phpunit/includes/parser/NewParserTest.php
index df7da98c..d95e9225 100644
--- a/tests/phpunit/includes/parser/NewParserTest.php
+++ b/tests/phpunit/includes/parser/NewParserTest.php
@@ -672,6 +672,7 @@ class NewParserTest extends MediaWikiTestCase {
/**
* @group medium
+ * @group ParserTests
* @dataProvider parserTestProvider
* @param string $desc
* @param string $input
diff --git a/tests/phpunit/includes/utils/IPTest.php b/tests/phpunit/includes/utils/IPTest.php
index 04b8f486..34aff796 100644
--- a/tests/phpunit/includes/utils/IPTest.php
+++ b/tests/phpunit/includes/utils/IPTest.php
@@ -307,12 +307,34 @@ class IPTest extends PHPUnit_Framework_TestCase {
}
/**
- * Improve IP::sanitizeIP() code coverage
- * @todo Most probably incomplete
+ * @covers IP::sanitizeIP
+ * @dataProvider provideSanitizeIP
*/
- public function testSanitizeIP() {
- $this->assertNull( IP::sanitizeIP( '' ) );
- $this->assertNull( IP::sanitizeIP( ' ' ) );
+ public function testSanitizeIP( $expected, $input ) {
+ $result = IP::sanitizeIP( $input );
+ $this->assertEquals( $expected, $result );
+ }
+
+ /**
+ * Provider for IP::testSanitizeIP()
+ */
+ public static function provideSanitizeIP() {
+ return array(
+ array( '0.0.0.0', '0.0.0.0' ),
+ array( '0.0.0.0', '00.00.00.00' ),
+ array( '0.0.0.0', '000.000.000.000' ),
+ array( '141.0.11.253', '141.000.011.253' ),
+ array( '1.2.4.5', '1.2.4.5' ),
+ array( '1.2.4.5', '01.02.04.05' ),
+ array( '1.2.4.5', '001.002.004.005' ),
+ array( '10.0.0.1', '010.0.000.1' ),
+ array( '80.72.250.4', '080.072.250.04' ),
+ array( 'Foo.1000.00', 'Foo.1000.00'),
+ array( 'Bar.01', 'Bar.01'),
+ array( 'Bar.010', 'Bar.010'),
+ array( null, ''),
+ array( null, ' ')
+ );
}
/**
@@ -336,6 +358,7 @@ class IPTest extends PHPUnit_Framework_TestCase {
array( '80000000', '128.0.0.0' ),
array( 'DEADCAFE', '222.173.202.254' ),
array( 'FFFFFFFF', '255.255.255.255' ),
+ array( '8D000BFD', '141.000.11.253' ),
array( false, 'IN.VA.LI.D' ),
array( 'v6-00000000000000000000000000000001', '::1' ),
array( 'v6-20010DB885A3000000008A2E03707334', '2001:0db8:85a3:0000:0000:8a2e:0370:7334' ),