summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/parser/ParserOutputTest.php
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-05-05 15:30:48 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-05-05 15:30:48 -0400
commit3d86add3dfa5e0b3ead9859593d4a52cf7555a34 (patch)
tree453d8bd3fda4dbb3020017ea1a469291da5cdc71 /tests/phpunit/includes/parser/ParserOutputTest.php
parent064cec79ca4c8201de0d06bbca6cb7a5345d11be (diff)
parent2e44b49a2db3026050b136de9b00f749dd3ff939 (diff)
Merge branch 'archwiki'
Diffstat (limited to 'tests/phpunit/includes/parser/ParserOutputTest.php')
-rw-r--r--tests/phpunit/includes/parser/ParserOutputTest.php59
1 files changed, 0 insertions, 59 deletions
diff --git a/tests/phpunit/includes/parser/ParserOutputTest.php b/tests/phpunit/includes/parser/ParserOutputTest.php
deleted file mode 100644
index c73666da..00000000
--- a/tests/phpunit/includes/parser/ParserOutputTest.php
+++ /dev/null
@@ -1,59 +0,0 @@
-<?php
-
-class ParserOutputTest extends MediaWikiTestCase {
-
- public static function provideIsLinkInternal() {
- return array(
- // Different domains
- array( false, 'http://example.org', 'http://mediawiki.org' ),
- // Same domains
- array( true, 'http://example.org', 'http://example.org' ),
- array( true, 'https://example.org', 'https://example.org' ),
- array( true, '//example.org', '//example.org' ),
- // Same domain different cases
- array( true, 'http://example.org', 'http://EXAMPLE.ORG' ),
- // Paths, queries, and fragments are not relevant
- array( true, 'http://example.org', 'http://example.org/wiki/Main_Page' ),
- array( true, 'http://example.org', 'http://example.org?my=query' ),
- array( true, 'http://example.org', 'http://example.org#its-a-fragment' ),
- // Different protocols
- array( false, 'http://example.org', 'https://example.org' ),
- array( false, 'https://example.org', 'http://example.org' ),
- // Protocol relative servers always match http and https links
- array( true, '//example.org', 'http://example.org' ),
- array( true, '//example.org', 'https://example.org' ),
- // But they don't match strange things like this
- array( false, '//example.org', 'irc://example.org' ),
- );
- }
-
- /**
- * Test to make sure ParserOutput::isLinkInternal behaves properly
- * @dataProvider provideIsLinkInternal
- * @covers ParserOutput::isLinkInternal
- */
- public function testIsLinkInternal( $shouldMatch, $server, $url ) {
- $this->assertEquals( $shouldMatch, ParserOutput::isLinkInternal( $server, $url ) );
- }
-
- /**
- * @covers ParserOutput::setExtensionData
- * @covers ParserOutput::getExtensionData
- */
- public function testExtensionData() {
- $po = new ParserOutput();
-
- $po->setExtensionData( "one", "Foo" );
-
- $this->assertEquals( "Foo", $po->getExtensionData( "one" ) );
- $this->assertNull( $po->getExtensionData( "spam" ) );
-
- $po->setExtensionData( "two", "Bar" );
- $this->assertEquals( "Foo", $po->getExtensionData( "one" ) );
- $this->assertEquals( "Bar", $po->getExtensionData( "two" ) );
-
- $po->setExtensionData( "one", null );
- $this->assertNull( $po->getExtensionData( "one" ) );
- $this->assertEquals( "Bar", $po->getExtensionData( "two" ) );
- }
-}