From 2e44b49a2db3026050b136de9b00f749dd3ff939 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 25 Apr 2014 06:26:49 +0200 Subject: Update to MediaWiki 1.22.6 --- extensions/Cite/.gitreview | 5 - extensions/Cite/.jshintignore | 1 - extensions/Cite/.jshintrc | 34 --- extensions/ConfirmEdit/.gitreview | 5 - extensions/Gadgets/.gitreview | 5 - extensions/Gadgets/tests/GadgetTest.php | 81 ------ extensions/ImageMap/.gitreview | 5 - extensions/InputBox/.gitreview | 5 - extensions/Interwiki/.gitreview | 6 - extensions/LocalisationUpdate/.gitreview | 5 - extensions/LocalisationUpdate/tests/tokenTest.php | 91 ------- extensions/Nuke/.gitreview | 5 - extensions/ParserFunctions/.gitreview | 5 - .../ParserFunctions/tests/ExpressionTest.php | 76 ------ extensions/PdfHandler/.gitreview | 5 - extensions/Poem/.gitreview | 5 - extensions/Renameuser/.gitreview | 5 - extensions/SpamBlacklist/.gitreview | 5 - extensions/SyntaxHighlight_GeSHi/.gitreview | 5 - extensions/TitleBlacklist/.gitreview | 5 - .../tests/ApiQueryTitleBlacklistTest.php | 110 -------- extensions/TitleBlacklist/tests/testSource | 4 - extensions/WikiEditor/.gitreview | 6 - extensions/WikiEditor/.jshintignore | 2 - extensions/WikiEditor/.jshintrc | 9 - .../tests/selenium/WikiDialogs_Links.php | 67 ----- .../tests/selenium/WikiDialogs_Links_Setup.php | 295 --------------------- .../tests/selenium/WikiEditorConstants.php | 84 ------ .../tests/selenium/WikiEditorSeleniumConfig.php | 27 -- .../tests/selenium/WikiEditorTestSuite.php | 35 --- 30 files changed, 998 deletions(-) delete mode 100644 extensions/Cite/.gitreview delete mode 100644 extensions/Cite/.jshintignore delete mode 100644 extensions/Cite/.jshintrc delete mode 100644 extensions/ConfirmEdit/.gitreview delete mode 100644 extensions/Gadgets/.gitreview delete mode 100644 extensions/Gadgets/tests/GadgetTest.php delete mode 100644 extensions/ImageMap/.gitreview delete mode 100644 extensions/InputBox/.gitreview delete mode 100644 extensions/Interwiki/.gitreview delete mode 100644 extensions/LocalisationUpdate/.gitreview delete mode 100644 extensions/LocalisationUpdate/tests/tokenTest.php delete mode 100644 extensions/Nuke/.gitreview delete mode 100644 extensions/ParserFunctions/.gitreview delete mode 100644 extensions/ParserFunctions/tests/ExpressionTest.php delete mode 100644 extensions/PdfHandler/.gitreview delete mode 100644 extensions/Poem/.gitreview delete mode 100644 extensions/Renameuser/.gitreview delete mode 100644 extensions/SpamBlacklist/.gitreview delete mode 100644 extensions/SyntaxHighlight_GeSHi/.gitreview delete mode 100644 extensions/TitleBlacklist/.gitreview delete mode 100644 extensions/TitleBlacklist/tests/ApiQueryTitleBlacklistTest.php delete mode 100644 extensions/TitleBlacklist/tests/testSource delete mode 100644 extensions/WikiEditor/.gitreview delete mode 100644 extensions/WikiEditor/.jshintignore delete mode 100644 extensions/WikiEditor/.jshintrc delete mode 100644 extensions/WikiEditor/tests/selenium/WikiDialogs_Links.php delete mode 100644 extensions/WikiEditor/tests/selenium/WikiDialogs_Links_Setup.php delete mode 100644 extensions/WikiEditor/tests/selenium/WikiEditorConstants.php delete mode 100644 extensions/WikiEditor/tests/selenium/WikiEditorSeleniumConfig.php delete mode 100644 extensions/WikiEditor/tests/selenium/WikiEditorTestSuite.php (limited to 'extensions') diff --git a/extensions/Cite/.gitreview b/extensions/Cite/.gitreview deleted file mode 100644 index 6ae9db41..00000000 --- a/extensions/Cite/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/Cite.git -defaultbranch=master diff --git a/extensions/Cite/.jshintignore b/extensions/Cite/.jshintignore deleted file mode 100644 index df46ab97..00000000 --- a/extensions/Cite/.jshintignore +++ /dev/null @@ -1 +0,0 @@ -modules/jquery.tooltip/jquery.tooltip.js diff --git a/extensions/Cite/.jshintrc b/extensions/Cite/.jshintrc deleted file mode 100644 index 4b356f81..00000000 --- a/extensions/Cite/.jshintrc +++ /dev/null @@ -1,34 +0,0 @@ -{ - "camelcase": true, - "curly": true, - "eqeqeq": true, - "immed": true, - "latedef": true, - "newcap": true, - "supernew": true, - "shadow": true, - "noarg": true, - "noempty": true, - "nonew": true, - "quotmark": false, // sometimes double quotes make sense, e.g. "foo's" is better readable than 'foo\'s' - "trailing": true, - "undef": true, - "unused": "vars", // we want to allow unused function parameters - "laxbreak": true, - "laxcomma": false, - "onevar": false, - "bitwise": false, - "forin": false, - "regexp": false, - "strict": true, - "scripturl": true, - - // Environment - "browser": true, - - // Globals - "predef": [ - "jQuery", - "mediaWiki" - ] -} diff --git a/extensions/ConfirmEdit/.gitreview b/extensions/ConfirmEdit/.gitreview deleted file mode 100644 index 780d35df..00000000 --- a/extensions/ConfirmEdit/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/ConfirmEdit.git -defaultbranch=master diff --git a/extensions/Gadgets/.gitreview b/extensions/Gadgets/.gitreview deleted file mode 100644 index a1a8ead4..00000000 --- a/extensions/Gadgets/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/Gadgets.git -defaultbranch=master diff --git a/extensions/Gadgets/tests/GadgetTest.php b/extensions/Gadgets/tests/GadgetTest.php deleted file mode 100644 index c9332a6c..00000000 --- a/extensions/Gadgets/tests/GadgetTest.php +++ /dev/null @@ -1,81 +0,0 @@ -assertEquals( 'Gadget', get_class( $g ) ); - - return $g; - } - - function testInvalidLines() { - $this->assertFalse( Gadget::newFromDefinition( '' ) ); - $this->assertFalse( Gadget::newFromDefinition( '' ) ); - } - - function testSimpleCases() { - $g = $this->create( '* foo bar| foo.css|foo.js|foo.bar' ); - $this->assertEquals( 'foo_bar', $g->getName() ); - $this->assertEquals( 'ext.gadget.foo_bar', $g->getModuleName() ); - $this->assertEquals( array( 'Gadget-foo.js' ), $g->getScripts() ); - $this->assertEquals( array( 'Gadget-foo.css' ), $g->getStyles() ); - $this->assertEquals( array( 'Gadget-foo.js', 'Gadget-foo.css' ), - $g->getScriptsAndStyles() ); - $this->assertEquals( array( 'Gadget-foo.js' ), $g->getLegacyScripts() ); - $this->assertFalse( $g->supportsResourceLoader() ); - $this->assertTrue( $g->hasModule() ); - } - - function testRLtag() { - $g = $this->create( '*foo [ResourceLoader]|foo.js|foo.css' ); - $this->assertEquals( 'foo', $g->getName() ); - $this->assertTrue( $g->supportsResourceLoader() ); - $this->assertEquals( 0, count( $g->getLegacyScripts() ) ); - } - - function testDependencies() { - $g = $this->create( '* foo[ResourceLoader|dependencies=jquery.ui]|bar.js' ); - $this->assertEquals( array( 'Gadget-bar.js' ), $g->getScripts() ); - $this->assertTrue( $g->supportsResourceLoader() ); - $this->assertEquals( array( 'jquery.ui' ), $g->getDependencies() ); - } - - function testPreferences() { - global $wgUser, $wgOut, $wgTitle; - - // This test makes call to the parser which requires valids Outputpage - // and Title objects. Set them up there, they will be released at the - // end of the test. - $old_wgOut = $wgOut; - $old_wgTitle = $wgTitle; - $wgTitle = Title::newFromText( 'Parser test for Gadgets extension' ); - - // Proceed with test setup: - $prefs = array(); - $context = new RequestContext(); - $wgOut = $context->getOutput(); - $wgOut->setTitle( Title::newFromText( 'test' ) ); - - Gadget::loadStructuredList( '* foo | foo.js -==keep-section1== -* bar| bar.js -==remove-section== -* baz [rights=embezzle] |baz.js -==keep-section2== -* quux [rights=read] | quux.js' ); - $this->assertTrue( GadgetHooks::getPreferences( $wgUser, $prefs ), 'GetPrefences hook should return true' ); - - $options = $prefs['gadgets']['options']; - $this->assertFalse( isset( $options['<gadget-section-remove-section>'] ), 'Must not show empty sections' ); - $this->assertTrue( isset( $options['<gadget-section-keep-section1>'] ) ); - $this->assertTrue( isset( $options['<gadget-section-keep-section2>'] ) ); - - // Restore globals - $wgOut = $old_wgOut; - $wgTitle = $old_wgTitle; - } -} diff --git a/extensions/ImageMap/.gitreview b/extensions/ImageMap/.gitreview deleted file mode 100644 index 2629c9d9..00000000 --- a/extensions/ImageMap/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/ImageMap.git -defaultbranch=master diff --git a/extensions/InputBox/.gitreview b/extensions/InputBox/.gitreview deleted file mode 100644 index 9d0c704d..00000000 --- a/extensions/InputBox/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/InputBox.git -defaultbranch=master diff --git a/extensions/Interwiki/.gitreview b/extensions/Interwiki/.gitreview deleted file mode 100644 index fcc03f61..00000000 --- a/extensions/Interwiki/.gitreview +++ /dev/null @@ -1,6 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/Interwiki.git -defaultbranch=master -defaultrebase=0 \ No newline at end of file diff --git a/extensions/LocalisationUpdate/.gitreview b/extensions/LocalisationUpdate/.gitreview deleted file mode 100644 index da37d04d..00000000 --- a/extensions/LocalisationUpdate/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/LocalisationUpdate.git -defaultbranch=master diff --git a/extensions/LocalisationUpdate/tests/tokenTest.php b/extensions/LocalisationUpdate/tests/tokenTest.php deleted file mode 100644 index 1112313c..00000000 --- a/extensions/LocalisationUpdate/tests/tokenTest.php +++ /dev/null @@ -1,91 +0,0 @@ -getVars(); - $retval = @$vars[$varname]; - } catch( Exception $e ) { - print $e . "\n"; - $retval = null; - } - return $retval; -} - -function quickTokenExtractArray( $php, $varname ) { - $reader = new QuickArrayReader("getVar( $varname ); -} - - -if( count( $args ) ) { - $sources = $args; -} else { - $sources = - array_merge( - glob("$IP/extensions/*/*.i18n.php"), - glob("$IP/languages/messages/Messages*.php") ); -} - -foreach( $sources as $sourceFile ) { - $rel = basename( $sourceFile ); - $out = str_replace( '/', '-', $rel ); - - $sourceData = file_get_contents( $sourceFile ); - - if( preg_match( '!extensions/!', $sourceFile ) ) { - $sourceData = LocalisationUpdate::cleanupExtensionFile( $sourceData ); - $items = 'langs'; - } else { - $sourceData = LocalisationUpdate::cleanupFile( $sourceData ); - $items = 'messages'; - } - - file_put_contents( "$out.txt", $sourceData ); - - $start = microtime(true); - $eval = evalExtractArray( $sourceData, 'messages' ); - $deltaEval = microtime(true) - $start; - - $start = microtime(true); - $quick = quickTokenExtractArray( $sourceData, 'messages' ); - $deltaQuick = microtime(true) - $start; - - $start = microtime(true); - $token = confExtractArray( $sourceData, 'messages' ); - $deltaToken = microtime(true) - $start; - - $hashEval = md5(serialize($eval)); - $hashToken = md5(serialize($token)); - $hashQuick = md5(serialize($quick)); - $countEval = count( (array)$eval); - $countToken = count( (array)$token ); - $countQuick = count( (array)$quick ); - - printf( "%s %s %d $items - %0.1fms - eval\n", $rel, $hashEval, $countEval, $deltaEval * 1000 ); - printf( "%s %s %d $items - %0.1fms - QuickArrayReader\n", $rel, $hashQuick, $countQuick, $deltaQuick * 1000 ); - printf( "%s %s %d $items - %0.1fms - ConfEditor\n", $rel, $hashToken, $countToken, $deltaToken * 1000 ); - - if( $hashEval !== $hashToken || $hashEval !== $hashQuick ) { - echo "FAILED on $rel\n"; - file_put_contents( "$out-eval.txt", var_export( $eval, true ) ); - file_put_contents( "$out-token.txt", var_export( $token, true ) ); - file_put_contents( "$out-quick.txt", var_export( $quick, true ) ); - #die("check eval.txt and token.txt\n"); - } - echo "\n"; -} - -echo "ok\n"; - diff --git a/extensions/Nuke/.gitreview b/extensions/Nuke/.gitreview deleted file mode 100644 index c623aede..00000000 --- a/extensions/Nuke/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/Nuke.git -defaultbranch=master diff --git a/extensions/ParserFunctions/.gitreview b/extensions/ParserFunctions/.gitreview deleted file mode 100644 index decb9867..00000000 --- a/extensions/ParserFunctions/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/ParserFunctions.git -defaultbranch=master diff --git a/extensions/ParserFunctions/tests/ExpressionTest.php b/extensions/ParserFunctions/tests/ExpressionTest.php deleted file mode 100644 index 169a9cb4..00000000 --- a/extensions/ParserFunctions/tests/ExpressionTest.php +++ /dev/null @@ -1,76 +0,0 @@ -parser = new ExprParser(); - } - - /** - * @dataProvider provideExpressions - */ - function testExpression( $input, $expected ) { - $this->assertEquals( - $expected, - $this->parser->doExpression( $input ) - ); - } - - function provideExpressions() { - return array( - array( '1 or 0', '1' ), - array( 'not (1 and 0)', '1' ), - array( 'not 0', '1' ), - array( '4 < 5', '1' ), - array( '-5 < 2', '1' ), - array( '-2 <= -2', '1' ), - array( '4 > 3', '1' ), - array( '4 > -3', '1' ), - array( '5 >= 2', '1' ), - array( '2 >= 2', '1' ), - array( '1 != 2', '1' ), - array( '-4 * -4 = 4 * 4', '1' ), - array( 'not (1 != 1)', '1' ), - array( '1 + 1', '2' ), - array( '-1 + 1', '0' ), - array( '+1 + 1', '2' ), - array( '4 * 4', '16' ), - array( '(1/3) * 3', '1' ), - array( '3 / 1.5', '2' ), - array( '3 / 0.2', '15' ), - array( '3 / ( 2.0 * 0.1 )', '15' ), - array( '3 / ( 2.0 / 10 )', '15' ), - array( '3 / (- 0.2 )', '-15' ), - array( '3 / abs( 0.2 )', '15' ), - array( '3 mod 2', '1' ), - array( '1e4', '10000' ), - array( '1e-2', '0.01' ), - array( '4.0 round 0', '4' ), - array( 'ceil 4', '4' ), - array( 'floor 4', '4' ), - array( '4.5 round 0', '5' ), - array( '4.2 round 0', '4' ), - array( '-4.2 round 0', '-4' ), - array( '-4.5 round 0', '-5' ), - array( '-2.0 round 0', '-2' ), - array( 'ceil -3', '-3' ), - array( 'floor -6.0', '-6' ), - array( 'ceil 4.2', '5' ), - array( 'ceil -4.5', '-4' ), - array( 'floor -4.5', '-5' ), - array( 'abs(-2)', '2' ), - array( 'ln(exp(1))', '1' ), - array( 'trunc(4.5)', '4' ), - array( 'trunc(-4.5)', '-4' ), - array( '123 fmod (2^64-1)', '123' ), - array( '5.7 mod 1.3', '0' ), - array( '5.7 fmod 1.3', '0.5' ), - ); - } -} - diff --git a/extensions/PdfHandler/.gitreview b/extensions/PdfHandler/.gitreview deleted file mode 100644 index f5eca40e..00000000 --- a/extensions/PdfHandler/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/PdfHandler.git -defaultbranch=master diff --git a/extensions/Poem/.gitreview b/extensions/Poem/.gitreview deleted file mode 100644 index aac78b2b..00000000 --- a/extensions/Poem/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/Poem.git -defaultbranch=master diff --git a/extensions/Renameuser/.gitreview b/extensions/Renameuser/.gitreview deleted file mode 100644 index 0d757141..00000000 --- a/extensions/Renameuser/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/Renameuser.git -defaultbranch=master diff --git a/extensions/SpamBlacklist/.gitreview b/extensions/SpamBlacklist/.gitreview deleted file mode 100644 index d74ae8f9..00000000 --- a/extensions/SpamBlacklist/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/SpamBlacklist.git -defaultbranch=master diff --git a/extensions/SyntaxHighlight_GeSHi/.gitreview b/extensions/SyntaxHighlight_GeSHi/.gitreview deleted file mode 100644 index cb9e4b44..00000000 --- a/extensions/SyntaxHighlight_GeSHi/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/SyntaxHighlight_GeSHi.git -defaultbranch=master diff --git a/extensions/TitleBlacklist/.gitreview b/extensions/TitleBlacklist/.gitreview deleted file mode 100644 index 964229c3..00000000 --- a/extensions/TitleBlacklist/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/TitleBlacklist.git -defaultbranch=master diff --git a/extensions/TitleBlacklist/tests/ApiQueryTitleBlacklistTest.php b/extensions/TitleBlacklist/tests/ApiQueryTitleBlacklistTest.php deleted file mode 100644 index 1f8164e7..00000000 --- a/extensions/TitleBlacklist/tests/ApiQueryTitleBlacklistTest.php +++ /dev/null @@ -1,110 +0,0 @@ - - */ - -ini_set( 'include_path', ini_get( 'include_path' ) . ':' . __DIR__ . '/../../../tests/phpunit/includes/api' ); - -/** - * @group medium - **/ -class ApiQueryTitleBlacklistTest extends ApiTestCase { - - function setUp() { - global $wgTitleBlacklistSources; - parent::setUp(); - $this->doLogin(); - - $wgTitleBlacklistSources = array( - array( - 'type' => TBLSRC_FILE, - 'src' => __DIR__ . '/testSource', - ), - ); - } - - /** - * Verify we allow a title which is not blacklisted - */ - function testCheckingUnlistedTitle() { - $unlisted = $this->doApiRequest( array( - 'action' => 'titleblacklist', - // evil_acc is blacklisted as - 'tbtitle' => 'evil_acc', - 'tbaction' => 'create', - 'tbnooverride' => true, - ) ); - - $this->assertEquals( - 'ok', - $unlisted[0]['titleblacklist']['result'], - 'Not blacklisted title returns ok' - ); - } - - /** - * Verify tboverride works - */ - function testTboverride() { - global $wgGroupPermissions; - - // Allow all users to override the titleblacklist - $wgGroupPermissions['*']['tboverride'] = true; - - $unlisted = $this->doApiRequest( array( - 'action' => 'titleblacklist', - 'tbtitle' => 'bar', - 'tbaction' => 'create', - ) ); - - $this->assertEquals( - 'ok', - $unlisted[0]['titleblacklist']['result'], - 'Blacklisted title returns ok if the user is allowd to tboverride' - ); - } - - /** - * Verify a blacklisted title gives out an error. - */ - function testCheckingBlackListedTitle() { - $listed = $this->doApiRequest( array( - 'action' => 'titleblacklist', - 'tbtitle' => 'bar', - 'tbaction' => 'create', - 'tbnooverride' => true, - ) ); - - $this->assertEquals( - 'blacklisted', - $listed[0]['titleblacklist']['result'], - 'Listed title returns error' - ); - $this->assertEquals( - "The title \"bar\" has been banned from creation.\nIt matches the following blacklist entry: [Bb]ar #example blacklist entry", - $listed[0]['titleblacklist']['reason'], - 'Listed title error text is as expected' - ); - - $this->assertEquals( - "titleblacklist-forbidden-edit", - $listed[0]['titleblacklist']['message'], - 'Correct blacklist message name is returned' - ); - - $this->assertEquals( - "[Bb]ar #example blacklist entry", - $listed[0]['titleblacklist']['line'], - 'Correct blacklist line is returned' - ); - - } -} diff --git a/extensions/TitleBlacklist/tests/testSource b/extensions/TitleBlacklist/tests/testSource deleted file mode 100644 index f73d9dd7..00000000 --- a/extensions/TitleBlacklist/tests/testSource +++ /dev/null @@ -1,4 +0,0 @@ -[Bb]ar #example blacklist entry -.*[Ff]ail.* -.*[Nn]yancat.* -.*evil_acc.* diff --git a/extensions/WikiEditor/.gitreview b/extensions/WikiEditor/.gitreview deleted file mode 100644 index 622413f0..00000000 --- a/extensions/WikiEditor/.gitreview +++ /dev/null @@ -1,6 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/WikiEditor.git -defaultbranch=master -defaultrebase=0 diff --git a/extensions/WikiEditor/.jshintignore b/extensions/WikiEditor/.jshintignore deleted file mode 100644 index 66a218b5..00000000 --- a/extensions/WikiEditor/.jshintignore +++ /dev/null @@ -1,2 +0,0 @@ -# upstream lib from Google -modules/contentCollector.js diff --git a/extensions/WikiEditor/.jshintrc b/extensions/WikiEditor/.jshintrc deleted file mode 100644 index 64cd5087..00000000 --- a/extensions/WikiEditor/.jshintrc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "predef": [ - "mediaWiki", - "jQuery" - ], - "browser": true, - "smarttabs": true, - "multistr": true -} diff --git a/extensions/WikiEditor/tests/selenium/WikiDialogs_Links.php b/extensions/WikiEditor/tests/selenium/WikiDialogs_Links.php deleted file mode 100644 index 7153f49f..00000000 --- a/extensions/WikiEditor/tests/selenium/WikiDialogs_Links.php +++ /dev/null @@ -1,67 +0,0 @@ -createNewPage(); - parent::verifyInternalLink(); - } - - // Add a internal link with different display text and verify - function testInternalLinkWithDisplayText() { - $this->createNewPage(); - parent::verifyInternalLinkWithDisplayText(); - } - - // Add a internal link with blank display text and verify - function testInternalLinkWithBlankDisplayText() { - $this->createNewPage(); - parent::verifyInternalLinkWithBlankDisplayText(); - } - - // Add external link and verify - function testExternalLink() { - $this->createNewPage(); - parent::verifyExternalLink(); - } - - // Add external link with different display text and verify - function testExternalLinkWithDisplayText( ) { - $this->createNewPage(); - parent::verifyExternalLinkWithDisplayText(); - } - - // Add external link with Blank display text and verify - function testExternalLinkWithBlankDisplayText() { - $this->createNewPage(); - parent::verifyExternalLinkWithBlankDisplayText(); - } - -} diff --git a/extensions/WikiEditor/tests/selenium/WikiDialogs_Links_Setup.php b/extensions/WikiEditor/tests/selenium/WikiDialogs_Links_Setup.php deleted file mode 100644 index 352ebec0..00000000 --- a/extensions/WikiEditor/tests/selenium/WikiDialogs_Links_Setup.php +++ /dev/null @@ -1,295 +0,0 @@ -open( $this->getUrl() . '/index.php' ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - } - - // Expand advance tool bar section if its not - function doExpandAdvanceSection() { - if ( !$this->isTextPresent( TEXT_HEADING ) ) { - $this->click( LINK_ADVANCED ); - } - } - - // Log out from the application - function doLogout() { - $this->open( $this->getUrl() . '/index.php' ); - if ( $this->isTextPresent( TEXT_LOGOUT ) ) { - $this->click( LINK_LOGOUT ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertEquals( TEXT_LOGOUT_CONFIRM, $this->getText( LINK_LOGIN ) ); - $this->open( $this->getUrl() . '/index.php' ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - } - } - - // Create a temporary fixture page - function doCreateInternalTestPageIfMissing() { - $this->type( INPUT_SEARCH_BOX, WIKI_INTERNAL_LINK ); - $this->click( BUTTON_SEARCH ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->click( LINK_START . WIKI_INTERNAL_LINK ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $location = $this->getLocation() . "\n"; - if ( strpos( $location, '&redlink=1' ) !== false ) { - $this->type( TEXT_EDITOR, "Test fixture page. No real content here" ); - $this->click( BUTTON_SAVE_WATCH ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertTrue( $this->isTextPresent( WIKI_INTERNAL_LINK ), - $this->getText( TEXT_PAGE_HEADING ) ); - } - } - - // Create a temporary new page - function doCreateNewPageTemporary() { - $this->type( INPUT_SEARCH_BOX, WIKI_TEMP_NEWPAGE ); - $this->click( BUTTON_SEARCH ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->click( LINK_START . WIKI_TEMP_NEWPAGE ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - } - - // Add a internal link and verify - function verifyInternalLink() { - $this->type( TEXT_EDITOR, "" ); - $this->click( LINK_ADDLINK ); - $this->waitForPopup( 'addLink', WIKI_TEST_WAIT_TIME ); - $this->type( TEXT_LINKNAME, ( WIKI_INTERNAL_LINK ) ); - $this->assertTrue( $this->isElementPresent( ICON_PAGEEXISTS ), 'Element ' . ICON_PAGEEXISTS . 'Not found' ); - $this->assertEquals( "on", $this->getValue( OPT_INTERNAL ) ); - $this->click( BUTTON_INSERTLINK ); - $this->click( LINK_PREVIEW ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertEquals( ( WIKI_INTERNAL_LINK ), $this->getText( LINK_START . WIKI_INTERNAL_LINK ) ); - $this->click( LINK_START . WIKI_INTERNAL_LINK ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertTrue( $this->isTextPresent( WIKI_INTERNAL_LINK ), $this->getText( TEXT_PAGE_HEADING ) ); - } - - // Add a internal link with different display text and verify - function verifyInternalLinkWithDisplayText() { - $this->type( TEXT_EDITOR, "" ); - $this->click( LINK_ADDLINK ); - $this->waitForPopup( 'addLink', WIKI_TEST_WAIT_TIME ); - $this->type( TEXT_LINKNAME, WIKI_INTERNAL_LINK ); - $this->type ( TEXT_LINKDISPLAYNAME, WIKI_INTERNAL_LINK . TEXT_LINKDISPLAYNAME_APPENDTEXT ); - $this->assertTrue( $this->isElementPresent( ICON_PAGEEXISTS ) ); - $this->assertEquals( "on", $this->getValue( OPT_INTERNAL ) ); - $this->click( BUTTON_INSERTLINK ); - $this->click( LINK_PREVIEW ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertEquals( WIKI_INTERNAL_LINK . TEXT_LINKDISPLAYNAME_APPENDTEXT, - $this->getText( LINK_START . WIKI_INTERNAL_LINK . TEXT_LINKDISPLAYNAME_APPENDTEXT ) ); - $this->click( LINK_START . WIKI_INTERNAL_LINK . TEXT_LINKDISPLAYNAME_APPENDTEXT ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertTrue( $this->isTextPresent( WIKI_INTERNAL_LINK ), $this->getText( TEXT_PAGE_HEADING ) ); - - } - - // Add a internal link with blank display text and verify - function verifyInternalLinkWithBlankDisplayText() { - $this->type( TEXT_EDITOR, "" ); - $this->click( LINK_ADDLINK ); - $this->waitForPopup( 'addLink', WIKI_TEST_WAIT_TIME ); - $this->type( TEXT_LINKNAME, WIKI_INTERNAL_LINK ); - $this->type( TEXT_LINKDISPLAYNAME, "" ); - $this->assertTrue( $this->isElementPresent( ICON_PAGEEXISTS ) ); - $this->assertEquals( "on", $this->getValue( OPT_INTERNAL ) ); - $this->click( BUTTON_INSERTLINK ); - $this->click( LINK_PREVIEW ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertEquals( WIKI_INTERNAL_LINK, $this->getText( LINK_START . WIKI_INTERNAL_LINK ) ); - $this->click( LINK_START . WIKI_INTERNAL_LINK ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertEquals( WIKI_INTERNAL_LINK, $this->getText( TEXT_PAGE_HEADING ) ); - - } - - // Add external link and verify - function verifyExternalLink() { - $this->type( LINK_PREVIEW, "" ); - $this->click( LINK_ADDLINK ); - $this->type( TEXT_LINKNAME, WIKI_EXTERNAL_LINK ); - $this->assertTrue( $this->isElementPresent( ICON_PAGEEXTERNAL ) ); - $this->assertEquals( "on", $this->getValue( OPT_EXTERNAL ) ); - $this->click( BUTTON_INSERTLINK ); - $this->click( LINK_PREVIEW ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertEquals( WIKI_EXTERNAL_LINK, $this->getText( LINK_START . WIKI_EXTERNAL_LINK ) ); - - $this->click( LINK_START . WIKI_EXTERNAL_LINK ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertEquals( WIKI_EXTERNAL_LINK_TITLE, $this->getTitle() ); - } - - // Add external link with different display text and verify - function verifyExternalLinkWithDisplayText() { - $this->type( TEXT_EDITOR, "" ); - $this->click( LINK_ADDLINK ); - $this->type( TEXT_LINKNAME, WIKI_EXTERNAL_LINK ); - $this->type( TEXT_LINKDISPLAYNAME, WIKI_EXTERNAL_LINK_TITLE ); - $this->assertTrue( $this->isElementPresent( ICON_PAGEEXTERNAL ) ); - $this->assertEquals( "on", $this->getValue( OPT_EXTERNAL ) ); - $this->click( BUTTON_INSERTLINK ); - $this->click( LINK_PREVIEW ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertEquals( WIKI_EXTERNAL_LINK_TITLE, $this->getText( LINK_START . WIKI_EXTERNAL_LINK_TITLE ) ); - $this->click( LINK_START . ( WIKI_EXTERNAL_LINK_TITLE ) ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertEquals( WIKI_EXTERNAL_LINK_TITLE , $this->getTitle() ); - } - - // Add external link with Blank display text and verify - function verifyExternalLinkWithBlankDisplayText() { - $this->type( TEXT_EDITOR, "" ); - $this->click( LINK_ADDLINK ); - $this->type( TEXT_LINKNAME, WIKI_EXTERNAL_LINK ); - $this->type( TEXT_LINKDISPLAYNAME, "" ); - $this->assertTrue( $this->isElementPresent( ICON_PAGEEXTERNAL ) ); - $this->assertEquals( "on", $this->getValue( OPT_EXTERNAL ) ); - $this->click( BUTTON_INSERTLINK ); - $this->click( LINK_PREVIEW ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertEquals( "[1]", $this->getText( LINK_START . "[1]" ) ); - $this->click( LINK_START . "[1]" ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertEquals( WIKI_EXTERNAL_LINK_TITLE, $this->getTitle() ); - } - - // Add a table and verify - function verifyCreateTable() { - $WIKI_TABLE_ROW = 2; - $WIKI_TABLE_COL = "5"; - $this->doExpandAdvanceSection(); - $this->type( TEXT_EDITOR, "" ); - $this->click( LINK_ADDTABLE ); - $this->click( CHK_SORT ); - $this->type( TEXT_ROW, $WIKI_TABLE_ROW ); - $this->type( TEXT_COL, $WIKI_TABLE_COL ); - $this->click( BUTTON_INSERTABLE ); - $this->click( CHK_SORT ); - $this->click( LINK_PREVIEW ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $WIKI_TABLE_ROW = $WIKI_TABLE_ROW + 1; - $this->assertTrue( $this->isElementPresent( TEXT_TABLEID_OTHER . - TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW . - TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL . - TEXT_VALIDATE_TABLE_PART3 ) ); - } - - // Add a table and verify only with head row - function verifyCreateTableWithHeadRow() { - $WIKI_TABLE_ROW = 3; - $WIKI_TABLE_COL = "4"; - $this->doExpandAdvanceSection(); - $this->type( TEXT_EDITOR, "" ); - $this->click( LINK_ADDTABLE ); - $this->click( CHK_BOARDER ); - $this->type( TEXT_ROW, $WIKI_TABLE_ROW ); - $this->type( TEXT_COL, $WIKI_TABLE_COL ); - $this->click( BUTTON_INSERTABLE ); - $this->click( LINK_PREVIEW ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $WIKI_TABLE_ROW = $WIKI_TABLE_ROW + 1; - $this->assertTrue( $this->isElementPresent( TEXT_TABLEID_OTHER . - TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW . - TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL . - TEXT_VALIDATE_TABLE_PART3 ) ); - } - - // Add a table and verify only with borders - function verifyCreateTableWithBorders() { - $WIKI_TABLE_ROW = "4"; - $WIKI_TABLE_COL = "6"; - $this->type( TEXT_EDITOR, "" ); - $this->click( LINK_ADDTABLE ); - $this->click( CHK_HEADER ); - $this->type( TEXT_ROW, $WIKI_TABLE_ROW ); - $this->type( TEXT_COL, $WIKI_TABLE_COL ); - $this->click( BUTTON_INSERTABLE ); - $this->click( CHK_HEADER ); - $this->click( LINK_PREVIEW ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertTrue( $this->isElementPresent( TEXT_TABLEID_OTHER . - TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW . - TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL . - TEXT_VALIDATE_TABLE_PART3 ) ); - } - - // Add a table and verify only with sort row - function verifyCreateTableWithSortRow() { - $WIKI_TABLE_ROW = "2"; - $WIKI_TABLE_COL = "5"; - $this->type( TEXT_EDITOR, "" ); - $this->click( LINK_ADDTABLE ); - $this->click( CHK_HEADER ); - $this->click( CHK_BOARDER ); - $this->click( CHK_SORT ); - $this->type( TEXT_ROW, $WIKI_TABLE_ROW ); - $this->type( TEXT_COL, $WIKI_TABLE_COL ); - $this->click( BUTTON_INSERTABLE ); - $this->click( CHK_HEADER ); - $this->click( CHK_BOARDER ); - $this->click( CHK_SORT ); - $this->click( LINK_PREVIEW ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertTrue( $this->isElementPresent( TEXT_TABLEID_WITHALLFEATURES . - TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW . - TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL . - TEXT_VALIDATE_TABLE_PART3 ) ); - } - - // Add a table without headers,borders and sort rows - function verifyCreateTableWithNoSpecialEffects() { - $WIKI_TABLE_ROW = "6"; - $WIKI_TABLE_COL = "2"; - $this-> - $this->doExpandAdvanceSection(); - $this->type( TEXT_EDITOR, "" ); - $this->click( LINK_ADDTABLE ); - $this->click( CHK_BOARDER ); - $this->click( CHK_HEADER ); - $this->type( TEXT_ROW, $WIKI_TABLE_ROW ); - $this->type( TEXT_COL, $WIKI_TABLE_COL ); - $this->click( BUTTON_INSERTABLE ); - $this->click( CHK_BOARDER ); - $this->click( CHK_HEADER ); - $this->click( INK_PREVIEW ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertTrue( $this->isElementPresent( TEXT_TABLEID_OTHER . - TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW . - TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL . - TEXT_VALIDATE_TABLE_PART3 ) ); - } - - // Add a table with headers,borders and sort rows - function verifyCreateTableWithAllSpecialEffects() { - $WIKI_TABLE_ROW = 6; - $WIKI_TABLE_COL = "2"; - $this->doExpandAdvanceSection(); - $this->type( TEXT_EDITOR, "" ); - $this->click( LINK_ADDTABLE ); - $this->click( CHK_SORT ); - $this->type( TEXT_ROW, $WIKI_TABLE_ROW ); - $this->type( TEXT_COL, $WIKI_TABLE_COL ); - $this->click( BUTTON_INSERTABLE ); - $this->click( CHK_SORT ); - $this->click( LINK_PREVIEW ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $WIKI_TABLE_ROW = $WIKI_TABLE_ROW + 1; - $this->assertTrue( $this->isElementPresent( TEXT_TABLEID_WITHALLFEATURES . - TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW . - TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL . - TEXT_VALIDATE_TABLE_PART3 ) ); - } - -} diff --git a/extensions/WikiEditor/tests/selenium/WikiEditorConstants.php b/extensions/WikiEditor/tests/selenium/WikiEditorConstants.php deleted file mode 100644 index 090f96bf..00000000 --- a/extensions/WikiEditor/tests/selenium/WikiEditorConstants.php +++ /dev/null @@ -1,84 +0,0 @@ - 'vector', - 'wgWikiEditorFeatures' => array( - 'toolbar' => array( 'global' => true, 'user' => true ), - 'toc' => array( 'global' => false, 'user' => false ), - 'highlight' => array( 'global' => false, 'user' => false ), - 'templateEditor' => array( 'global' => false, 'user' => false ), - 'dialogs' => array( 'global' => true, 'user' => true ) - ), - 'wgVectorFeatures' => array( - 'editwarning' => array( 'global' => false, 'user' => false ) - ) - ); - $includeFiles = array_merge( $includeFiles, $includes ); - $globalConfigs = array_merge( $globalConfigs, $configs ); - return true; - } -} \ No newline at end of file diff --git a/extensions/WikiEditor/tests/selenium/WikiEditorTestSuite.php b/extensions/WikiEditor/tests/selenium/WikiEditorTestSuite.php deleted file mode 100644 index b4029d3a..00000000 --- a/extensions/WikiEditor/tests/selenium/WikiEditorTestSuite.php +++ /dev/null @@ -1,35 +0,0 @@ - false, 'user' => false ); - * $wgWikiEditorFeatures['templateEditor'] = array( 'global' => false, 'user' => false ); - * $wgWikiEditorFeatures['toolbar'] = array( 'global' => true, 'user' => true ); - * $wgWikiEditorFeatures['toc'] = array( 'global' => false, 'user' => false ); - * $wgWikiEditorFeatures['highlight'] = array( 'global' => false, 'user' => false ); - * $wgWikiEditorFeatures['dialogs'] = array( 'global' => true, 'user' => true ); - * - */ -class WikiEditorTestSuite extends SeleniumTestSuite -{ - public function setUp() { - $this->setLoginBeforeTests( false ); - parent::setUp(); - } - public function addTests() { - $testFiles = array( - 'extensions/WikiEditor/tests/selenium/WikiDialogs_Links.php' - ); - parent::addTestFiles( $testFiles ); - } - - -} -- cgit v1.2.2