From: Siebrand Mazeland Date: Fri, 15 Feb 2013 11:38:53 +0000 (+0100) Subject: Update formatting X-Git-Tag: 1.31.0-rc.0~20680 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=69d4d690965882d4d280d3244a3e64b76e3802ef;p=lhc%2Fweb%2Fwiklou.git Update formatting 11 of n. Change-Id: Ifdaf198b16bf72e1e0a3d3802c041d239096ae28 --- diff --git a/tests/phpunit/includes/upload/UploadTest.php b/tests/phpunit/includes/upload/UploadTest.php index 34c57aaf81..b809d3205b 100644 --- a/tests/phpunit/includes/upload/UploadTest.php +++ b/tests/phpunit/includes/upload/UploadTest.php @@ -12,7 +12,7 @@ class UploadTest extends MediaWikiTestCase { $this->upload = new UploadTestHandler; $this->hooks = $wgHooks; - $wgHooks['InterwikiLoadPrefix'][] = function( $prefix, &$data ) { + $wgHooks['InterwikiLoadPrefix'][] = function ( $prefix, &$data ) { return false; }; } @@ -28,7 +28,7 @@ class UploadTest extends MediaWikiTestCase { /** * First checks the return code * of UploadBase::getTitle() and then the actual returned title - * + * * @dataProvider provideTestTitleValidation */ public function testTitleValidation( $srcFilename, $dstFilename, $code, $msg ) { @@ -44,38 +44,38 @@ class UploadTest extends MediaWikiTestCase { "$msg text" ); } } - + /** * Test various forms of valid and invalid titles that can be supplied. */ public static function provideTestTitleValidation() { return array( /* Test a valid title */ - array( 'ValidTitle.jpg', 'ValidTitle.jpg', UploadBase::OK, + array( 'ValidTitle.jpg', 'ValidTitle.jpg', UploadBase::OK, 'upload valid title' ), /* A title with a slash */ - array( 'A/B.jpg', 'B.jpg', UploadBase::OK, + array( 'A/B.jpg', 'B.jpg', UploadBase::OK, 'upload title with slash' ), /* A title with illegal char */ - array( 'A:B.jpg', 'A-B.jpg', UploadBase::OK, + array( 'A:B.jpg', 'A-B.jpg', UploadBase::OK, 'upload title with colon' ), /* Stripping leading File: prefix */ - array( 'File:C.jpg', 'C.jpg', UploadBase::OK, + array( 'File:C.jpg', 'C.jpg', UploadBase::OK, 'upload title with File prefix' ), /* Test illegal suggested title (r94601) */ - array( '%281%29.JPG', null, UploadBase::ILLEGAL_FILENAME, + array( '%281%29.JPG', null, UploadBase::ILLEGAL_FILENAME, 'illegal title for upload' ), /* A title without extension */ - array( 'A', null, UploadBase::FILETYPE_MISSING, + array( 'A', null, UploadBase::FILETYPE_MISSING, 'upload title without extension' ), /* A title with no basename */ - array( '.jpg', null, UploadBase::MIN_LENGTH_PARTNAME, + array( '.jpg', null, UploadBase::MIN_LENGTH_PARTNAME, 'upload title without basename' ), /* A title that is longer than 255 bytes */ - array( str_repeat( 'a', 255 ) . '.jpg', null, UploadBase::FILENAME_TOO_LONG, + array( str_repeat( 'a', 255 ) . '.jpg', null, UploadBase::FILENAME_TOO_LONG, 'upload title longer than 255 bytes' ), /* A title that is longer than 240 bytes */ - array( str_repeat( 'a', 240 ) . '.jpg', null, UploadBase::FILENAME_TOO_LONG, + array( str_repeat( 'a', 240 ) . '.jpg', null, UploadBase::FILENAME_TOO_LONG, 'upload title longer than 240 bytes' ), ); } @@ -118,26 +118,27 @@ class UploadTest extends MediaWikiTestCase { $wgMaxUploadSize = 100; $filename = $this->createFileOfSize( $wgMaxUploadSize ); - $this->upload->initializePathInfo( basename($filename) . '.txt', $filename, 100 ); + $this->upload->initializePathInfo( basename( $filename ) . '.txt', $filename, 100 ); $result = $this->upload->verifyUpload(); unlink( $filename ); $this->assertEquals( array( 'status' => UploadBase::OK ), $result ); - $wgMaxUploadSize = $savedGlobal; // restore global + $wgMaxUploadSize = $savedGlobal; // restore global } } class UploadTestHandler extends UploadBase { - public function initializeFromRequest( &$request ) { } - public function testTitleValidation( $name ) { - $this->mTitle = false; - $this->mDesiredDestName = $name; - $this->mTitleError = UploadBase::OK; - $this->getTitle(); - return $this->mTitleError; - } + public function initializeFromRequest( &$request ) {} + + public function testTitleValidation( $name ) { + $this->mTitle = false; + $this->mDesiredDestName = $name; + $this->mTitleError = UploadBase::OK; + $this->getTitle(); + return $this->mTitleError; + } } diff --git a/tests/phpunit/maintenance/MaintenanceTest.php b/tests/phpunit/maintenance/MaintenanceTest.php index b9c0fb80f5..235e9adc58 100644 --- a/tests/phpunit/maintenance/MaintenanceTest.php +++ b/tests/phpunit/maintenance/MaintenanceTest.php @@ -81,14 +81,14 @@ class MaintenanceFixup extends Maintenance { return; } - return call_user_func_array ( array( "parent", __FUNCTION__ ), func_get_args() ); + return call_user_func_array( array( "parent", __FUNCTION__ ), func_get_args() ); } /** * Safety net around register_shutdown_function of Maintenance.php */ public function __destruct() { - if ( ! $this->shutdownSimulated ) { + if ( !$this->shutdownSimulated ) { // Someone generated a MaintenanceFixup instance without calling // simulateShutdown. We'd have to raise a PHPUnit exception to correctly // flag this illegal usage. However, we are already in a destruktor, which @@ -112,7 +112,6 @@ class MaintenanceFixup extends Maintenance { } - // --- Making protected functions visible for test public function output( $out, $channel = null ) { @@ -120,11 +119,10 @@ class MaintenanceFixup extends Maintenance { // Maintenance::output signature. However, we do not use (or rely on) // those variables. Instead we pass to Maintenance::output whatever we // receive at runtime. - return call_user_func_array ( array( "parent", __FUNCTION__ ), func_get_args() ); + return call_user_func_array( array( "parent", __FUNCTION__ ), func_get_args() ); } - // --- Requirements for getting instance of abstract class public function execute() { @@ -173,7 +171,7 @@ class MaintenanceTest extends MediaWikiTestCase { private function assertOutputPrePostShutdown( $preShutdownOutput, $expectNLAppending ) { $this->assertEquals( $preShutdownOutput, $this->getActualOutput(), - "Output before shutdown simulation" ); + "Output before shutdown simulation" ); $this->m->simulateShutdown(); $this->m = null; @@ -710,7 +708,7 @@ class MaintenanceTest extends MediaWikiTestCase { $m2->output( "bar" ); $this->assertEquals( "foobar", $this->getActualOutput(), - "Output before shutdown simulation (m2)" ); + "Output before shutdown simulation (m2)" ); $m2->simulateShutdown(); $this->assertOutputPrePostShutdown( "foobar", false ); } @@ -722,7 +720,7 @@ class MaintenanceTest extends MediaWikiTestCase { $m2->output( "bar", null ); $this->assertEquals( "foobar", $this->getActualOutput(), - "Output before shutdown simulation (m2)" ); + "Output before shutdown simulation (m2)" ); $m2->simulateShutdown(); $this->assertOutputPrePostShutdown( "foobar", false ); } @@ -734,7 +732,7 @@ class MaintenanceTest extends MediaWikiTestCase { $m2->output( "bar", "bazChannel" ); $this->assertEquals( "foobar", $this->getActualOutput(), - "Output before shutdown simulation (m2)" ); + "Output before shutdown simulation (m2)" ); $m2->simulateShutdown(); $this->assertOutputPrePostShutdown( "foobar\n", true ); } @@ -746,7 +744,7 @@ class MaintenanceTest extends MediaWikiTestCase { $m2->output( "bar\n", null ); $this->assertEquals( "foo\nbar\n", $this->getActualOutput(), - "Output before shutdown simulation (m2)" ); + "Output before shutdown simulation (m2)" ); $m2->simulateShutdown(); $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); } @@ -758,7 +756,7 @@ class MaintenanceTest extends MediaWikiTestCase { $m2->output( "bar\n", "bazChannel" ); $this->assertEquals( "foobar", $this->getActualOutput(), - "Output before shutdown simulation (m2)" ); + "Output before shutdown simulation (m2)" ); $m2->simulateShutdown(); $this->assertOutputPrePostShutdown( "foobar\n", true ); } @@ -770,7 +768,7 @@ class MaintenanceTest extends MediaWikiTestCase { $m2->outputChanneled( "bar" ); $this->assertEquals( "foo\nbar\n", $this->getActualOutput(), - "Output before shutdown simulation (m2)" ); + "Output before shutdown simulation (m2)" ); $m2->simulateShutdown(); $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); } @@ -782,7 +780,7 @@ class MaintenanceTest extends MediaWikiTestCase { $m2->outputChanneled( "bar", null ); $this->assertEquals( "foo\nbar\n", $this->getActualOutput(), - "Output before shutdown simulation (m2)" ); + "Output before shutdown simulation (m2)" ); $m2->simulateShutdown(); $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); } @@ -794,7 +792,7 @@ class MaintenanceTest extends MediaWikiTestCase { $m2->outputChanneled( "bar", "bazChannel" ); $this->assertEquals( "foobar", $this->getActualOutput(), - "Output before shutdown simulation (m2)" ); + "Output before shutdown simulation (m2)" ); $m2->simulateShutdown(); $this->assertOutputPrePostShutdown( "foobar\n", true ); } @@ -806,13 +804,13 @@ class MaintenanceTest extends MediaWikiTestCase { $m2->outputChanneled( "bar", "bazChannel" ); $this->assertEquals( "foobar", $this->getActualOutput(), - "Output before first cleanup" ); + "Output before first cleanup" ); $this->m->cleanupChanneled(); $this->assertEquals( "foobar\n", $this->getActualOutput(), - "Output after first cleanup" ); + "Output after first cleanup" ); $m2->cleanupChanneled(); $this->assertEquals( "foobar\n\n", $this->getActualOutput(), - "Output after second cleanup" ); + "Output after second cleanup" ); $m2->simulateShutdown(); $this->assertOutputPrePostShutdown( "foobar\n\n", false ); diff --git a/tests/phpunit/maintenance/backup_PageTest.php b/tests/phpunit/maintenance/backup_PageTest.php index d7f2feb414..07c7670523 100644 --- a/tests/phpunit/maintenance/backup_PageTest.php +++ b/tests/phpunit/maintenance/backup_PageTest.php @@ -23,7 +23,7 @@ class BackupDumperPageTest extends DumpTestCase { $this->setMwGlobals( array( 'wgLanguageCode' => 'en', 'wgContLang' => Language::factory( 'en' ), - )); + ) ); $this->tablesUsed[] = 'page'; $this->tablesUsed[] = 'revision'; @@ -36,7 +36,7 @@ class BackupDumperPageTest extends DumpTestCase { if ( $this->namespace === $this->talk_namespace ) { //@todo: work around this. throw new MWException( "The default wikitext namespace is the talk namespace. " - . " We can't currently deal with that."); + . " We can't currently deal with that." ); } $this->pageTitle1 = Title::newFromText( 'BackupDumperTestP1', $this->namespace ); @@ -96,10 +96,10 @@ class BackupDumperPageTest extends DumpTestCase { } - function testFullTextPlain () { + function testFullTextPlain() { // Preparing the dump $fname = $this->getNewTempFile(); - $dumper = new BackupDumper( array ( "--output=file:" . $fname ) ); + $dumper = new BackupDumper( array( "--output=file:" . $fname ) ); $dumper->startId = $this->pageId1; $dumper->endId = $this->pageId4 + 1; $dumper->reporting = false; @@ -147,10 +147,10 @@ class BackupDumperPageTest extends DumpTestCase { $this->assertDumpEnd(); } - function testFullStubPlain () { + function testFullStubPlain() { // Preparing the dump $fname = $this->getNewTempFile(); - $dumper = new BackupDumper( array ( "--output=file:" . $fname ) ); + $dumper = new BackupDumper( array( "--output=file:" . $fname ) ); $dumper->startId = $this->pageId1; $dumper->endId = $this->pageId4 + 1; $dumper->reporting = false; @@ -192,10 +192,10 @@ class BackupDumperPageTest extends DumpTestCase { $this->assertDumpEnd(); } - function testCurrentStubPlain () { + function testCurrentStubPlain() { // Preparing the dump $fname = $this->getNewTempFile(); - $dumper = new BackupDumper( array ( "--output=file:" . $fname ) ); + $dumper = new BackupDumper( array( "--output=file:" . $fname ) ); $dumper->startId = $this->pageId1; $dumper->endId = $this->pageId4 + 1; $dumper->reporting = false; @@ -231,12 +231,12 @@ class BackupDumperPageTest extends DumpTestCase { $this->assertDumpEnd(); } - function testCurrentStubGzip () { + function testCurrentStubGzip() { $this->checkHasGzip(); // Preparing the dump $fname = $this->getNewTempFile(); - $dumper = new BackupDumper( array ( "--output=gzip:" . $fname ) ); + $dumper = new BackupDumper( array( "--output=gzip:" . $fname ) ); $dumper->startId = $this->pageId1; $dumper->endId = $this->pageId4 + 1; $dumper->reporting = false; @@ -274,8 +274,7 @@ class BackupDumperPageTest extends DumpTestCase { } - - function testXmlDumpsBackupUseCase () { + function testXmlDumpsBackupUseCase() { // xmldumps-backup typically performs a single dump that that writes // out three files // * gzipped stubs of everything (meta-history) @@ -292,11 +291,11 @@ class BackupDumperPageTest extends DumpTestCase { $fnameMetaCurrent = $this->getNewTempFile(); $fnameArticles = $this->getNewTempFile(); - $dumper = new BackupDumper( array ( "--output=gzip:" . $fnameMetaHistory, - "--output=gzip:" . $fnameMetaCurrent, "--filter=latest", - "--output=gzip:" . $fnameArticles, "--filter=latest", - "--filter=notalk", "--filter=namespace:!NS_USER", - "--reporting=1000" ) ); + $dumper = new BackupDumper( array( "--output=gzip:" . $fnameMetaHistory, + "--output=gzip:" . $fnameMetaCurrent, "--filter=latest", + "--output=gzip:" . $fnameArticles, "--filter=latest", + "--filter=notalk", "--filter=namespace:!NS_USER", + "--reporting=1000" ) ); $dumper->startId = $this->pageId1; $dumper->endId = $this->pageId4 + 1; $dumper->setDb( $this->db ); @@ -406,5 +405,4 @@ class BackupDumperPageTest extends DumpTestCase { } - } diff --git a/tests/phpunit/maintenance/fetchTextTest.php b/tests/phpunit/maintenance/fetchTextTest.php index 04536f87c5..4d1d45d6ba 100644 --- a/tests/phpunit/maintenance/fetchTextTest.php +++ b/tests/phpunit/maintenance/fetchTextTest.php @@ -26,7 +26,6 @@ class SemiMockedFetchText extends FetchText { private $mockInvocations = array( 'getStdin' => 0 ); - /** * Data for the fake stdin * @@ -57,7 +56,7 @@ class SemiMockedFetchText extends FetchText { "Tried to get stdin with non null parameter" ); } - if ( ! $this->mockSetUp ) { + if ( !$this->mockSetUp ) { throw new PHPUnit_Framework_ExpectationFailedException( "Tried to get stdin before setting up rerouting" ); } @@ -172,7 +171,6 @@ class FetchTextTest extends MediaWikiTestCase { } - // Instead of the following functions, a data provider would be great. // However, as data providers are evaluated /before/ addDBData, a data // provider would not know the required ids. @@ -189,14 +187,14 @@ class FetchTextTest extends MediaWikiTestCase { function testExistingSeveral() { $this->assertFilter( "$this->textId1\n$this->textId5\n" - . "$this->textId3\n$this->textId3", + . "$this->textId3\n$this->textId3", implode( "", array( - $this->textId1 . "\n23\nFetchTextTestPage1Text1", - $this->textId5 . "\n44\nFetchTextTestPage2Text4 " + $this->textId1 . "\n23\nFetchTextTestPage1Text1", + $this->textId5 . "\n44\nFetchTextTestPage2Text4 " . "some additional Text", - $this->textId3 . "\n23\nFetchTextTestPage2Text2", - $this->textId3 . "\n23\nFetchTextTestPage2Text2" - ) ) ); + $this->textId3 . "\n23\nFetchTextTestPage2Text2", + $this->textId3 . "\n23\nFetchTextTestPage2Text2" + ) ) ); } function testEmpty() { @@ -228,15 +226,15 @@ class FetchTextTest extends MediaWikiTestCase { function testMix() { $this->assertFilter( "ab\n" . $this->textId4 . ".5cd\n\nefg\n" . $this->textId2 - . "\n" . $this->textId3, + . "\n" . $this->textId3, implode( "", array( - "0\n-1\n", - $this->textId4 . "\n23\nFetchTextTestPage2Text3", - "0\n-1\n", - "0\n-1\n", - $this->textId2 . "\n23\nFetchTextTestPage2Text1", - $this->textId3 . "\n23\nFetchTextTestPage2Text2" - ) ) ); + "0\n-1\n", + $this->textId4 . "\n23\nFetchTextTestPage2Text3", + "0\n-1\n", + "0\n-1\n", + $this->textId2 . "\n23\nFetchTextTestPage2Text1", + $this->textId3 . "\n23\nFetchTextTestPage2Text2" + ) ) ); } } diff --git a/tests/phpunit/skins/SideBarTest.php b/tests/phpunit/skins/SideBarTest.php index 85ed0b48cf..3902b68620 100644 --- a/tests/phpunit/skins/SideBarTest.php +++ b/tests/phpunit/skins/SideBarTest.php @@ -22,8 +22,8 @@ class SideBarTest extends MediaWikiLangTestCase { 'helppage', ); - foreach( $URL_messages as $m ) { - $titleName = MessageCache::singleton()->get($m); + foreach ( $URL_messages as $m ) { + $titleName = MessageCache::singleton()->get( $m ); $title = Title::newFromText( $titleName ); $this->messages[$m]['href'] = $title->getLocalURL(); } @@ -35,6 +35,7 @@ class SideBarTest extends MediaWikiLangTestCase { $this->skin = new SkinTemplate(); $this->skin->getContext()->setLanguage( Language::factory( 'en' ) ); } + protected function tearDown() { parent::tearDown(); $this->skin = null; @@ -54,11 +55,11 @@ class SideBarTest extends MediaWikiLangTestCase { function testSidebarWithOnlyTwoTitles() { $this->assertSideBar( - array( - 'Title1' => array(), - 'Title2' => array(), - ), -'* Title1 + array( + 'Title1' => array(), + 'Title2' => array(), + ), + '* Title1 * Title2 ' ); @@ -66,15 +67,15 @@ class SideBarTest extends MediaWikiLangTestCase { function testExpandMessages() { $this->assertSidebar( - array( 'Title' => array( - array( - 'text' => 'Help', - 'href' => $this->messages['helppage']['href'], - 'id' => 'n-help', - 'active' => null - ) - )), -'* Title + array( 'Title' => array( + array( + 'text' => 'Help', + 'href' => $this->messages['helppage']['href'], + 'id' => 'n-help', + 'active' => null + ) + ) ), + '* Title ** helppage|help ' ); @@ -82,63 +83,62 @@ class SideBarTest extends MediaWikiLangTestCase { function testExternalUrlsRequireADescription() { $this->assertSidebar( - array( 'Title' => array( - # ** http://www.mediawiki.org/| Home - array( - 'text' => 'Home', - 'href' => 'http://www.mediawiki.org/', - 'id' => 'n-Home', - 'active' => null, - 'rel' => 'nofollow', - ), - # ** http://valid.no.desc.org/ - # ... skipped since it is missing a pipe with a description - )), -'* Title + array( 'Title' => array( + # ** http://www.mediawiki.org/| Home + array( + 'text' => 'Home', + 'href' => 'http://www.mediawiki.org/', + 'id' => 'n-Home', + 'active' => null, + 'rel' => 'nofollow', + ), + # ** http://valid.no.desc.org/ + # ... skipped since it is missing a pipe with a description + ) ), + '* Title ** http://www.mediawiki.org/| Home ** http://valid.no.desc.org/ ' - ); } + /** * bug 33321 - Make sure there's a | after transforming. * @group Database */ function testTrickyPipe() { $this->assertSidebar( - array( 'Title' => array( - # The first 2 are skipped - # Doesn't really test the url properly - # because it will vary with $wgArticlePath et al. - # ** Baz|Fred - array( - 'text' => 'Fred', - 'href' => Title::newFromText( 'Baz' )->getLocalUrl(), - 'id' => 'n-Fred', - 'active' => null, - ), - array( - 'text' => 'title-to-display', - 'href' => Title::newFromText( 'page-to-go-to' )->getLocalUrl(), - 'id' => 'n-title-to-display', - 'active' => null, - ), - )), -'* Title + array( 'Title' => array( + # The first 2 are skipped + # Doesn't really test the url properly + # because it will vary with $wgArticlePath et al. + # ** Baz|Fred + array( + 'text' => 'Fred', + 'href' => Title::newFromText( 'Baz' )->getLocalUrl(), + 'id' => 'n-Fred', + 'active' => null, + ), + array( + 'text' => 'title-to-display', + 'href' => Title::newFromText( 'page-to-go-to' )->getLocalUrl(), + 'id' => 'n-title-to-display', + 'active' => null, + ), + ) ), + '* Title ** {{PAGENAME|Foo}} ** Bar ** Baz|Fred ** {{PLURAL:1|page-to-go-to{{int:pipe-separator/en}}title-to-display|branch not taken}} ' ); - } #### Attributes for external links ########################## - private function getAttribs( ) { + private function getAttribs() { # Sidebar text we will use everytime $text = '* Title ** http://www.mediawiki.org/| Home'; diff --git a/tests/phpunit/suites/UploadFromUrlTestSuite.php b/tests/phpunit/suites/UploadFromUrlTestSuite.php index 366d8f29d7..28d38ab40b 100644 --- a/tests/phpunit/suites/UploadFromUrlTestSuite.php +++ b/tests/phpunit/suites/UploadFromUrlTestSuite.php @@ -17,8 +17,8 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite { protected function setUp() { global $wgParser, $wgParserConf, $IP, $messageMemc, $wgMemc, - $wgUser, $wgLang, $wgOut, $wgRequest, $wgStyleDirectory, $wgEnableParserCache, - $wgNamespaceAliases, $wgNamespaceProtection, $parserMemc; + $wgUser, $wgLang, $wgOut, $wgRequest, $wgStyleDirectory, $wgEnableParserCache, + $wgNamespaceAliases, $wgNamespaceProtection, $parserMemc; $tmpGlobals = array(); @@ -29,18 +29,18 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite { $tmpGlobals['wgStylePath'] = '/skins'; $tmpGlobals['wgThumbnailScriptPath'] = false; $tmpGlobals['wgLocalFileRepo'] = array( - 'class' => 'LocalRepo', - 'name' => 'local', - 'url' => 'http://example.com/images', - 'hashLevels' => 2, + 'class' => 'LocalRepo', + 'name' => 'local', + 'url' => 'http://example.com/images', + 'hashLevels' => 2, 'transformVia404' => false, - 'backend' => new FSFileBackend( array( - 'name' => 'local-backend', + 'backend' => new FSFileBackend( array( + 'name' => 'local-backend', 'lockManager' => 'fsLockManager', 'containerPaths' => array( - 'local-public' => wfTempDir() . '/test-repo/public', - 'local-thumb' => wfTempDir() . '/test-repo/thumb', - 'local-temp' => wfTempDir() . '/test-repo/temp', + 'local-public' => wfTempDir() . '/test-repo/public', + 'local-thumb' => wfTempDir() . '/test-repo/thumb', + 'local-temp' => wfTempDir() . '/test-repo/temp', 'local-deleted' => wfTempDir() . '/test-repo/delete', ) ) ), @@ -72,7 +72,7 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite { $wgRequest = $context->getRequest(); if ( $wgStyleDirectory === false ) { - $wgStyleDirectory = "$IP/skins"; + $wgStyleDirectory = "$IP/skins"; } RepoGroup::destroySingleton(); @@ -105,7 +105,7 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite { // delete the files first, then the dirs. self::deleteFiles( - array ( + array( "$dir/3/3a/Foobar.jpg", "$dir/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg", "$dir/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg", @@ -117,7 +117,7 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite { ); self::deleteDirs( - array ( + array( "$dir/3/3a", "$dir/3", "$dir/thumb/6/65", diff --git a/tests/selenium/Selenium.php b/tests/selenium/Selenium.php index ecf7f9ec94..5a067c272c 100644 --- a/tests/selenium/Selenium.php +++ b/tests/selenium/Selenium.php @@ -47,7 +47,9 @@ class Selenium { public function start() { $this->tester = new Testing_Selenium( $this->browser, self::$url, $this->host, $this->port, $this->timeout ); - if ( method_exists( $this->tester, "setVerbose" ) ) $this->tester->setVerbose( $this->verbose ); + if ( method_exists( $this->tester, "setVerbose" ) ) { + $this->tester->setVerbose( $this->verbose ); + } $this->tester->start(); $this->isStarted = true; @@ -94,7 +96,7 @@ class Selenium { $this->logger = $logger; } - public function getLogger( ) { + public function getLogger() { return $this->logger; } @@ -122,22 +124,21 @@ class Selenium { $this->user = $user; } - // Function to get username - public function getUser() { + // Function to get username + public function getUser() { return $this->user; } - + public function setPass( $pass ) { $this->pass = $pass; } - //add function to get password - public function getPass( ) { + //add function to get password + public function getPass() { return $this->pass; } - - + public function setHost( $host ) { $this->host = $host; } @@ -154,7 +155,7 @@ class Selenium { $this->junitlogfile = $junitlogfile; } - public function getJUnitLogfile( ) { + public function getJUnitLogfile() { return $this->junitlogfile; } @@ -163,7 +164,7 @@ class Selenium { } public function setBrowser( $b ) { - if ($this->runagainstgrid) { + if ( $this->runagainstgrid ) { $this->browser = $b; return true; } @@ -184,7 +185,7 @@ class Selenium { } // Prevent external cloning - protected function __clone() { } + protected function __clone() {} // Prevent external construction // protected function __construct() {} } diff --git a/tests/selenium/SeleniumServerManager.php b/tests/selenium/SeleniumServerManager.php index 9e2d4aa8f5..3fbc8317cb 100644 --- a/tests/selenium/SeleniumServerManager.php +++ b/tests/selenium/SeleniumServerManager.php @@ -34,15 +34,22 @@ class SeleniumServerManager { private $SeleniumServerExecPath; public function __construct( $startServer, - $serverPort, - $serverExecPath ) { - $this->OS = (string) PHP_OS; - if ( isset( $startServer ) ) + $serverPort, + $serverExecPath ) { + $this->OS = (string)PHP_OS; + + if ( isset( $startServer ) ) { $this->SeleniumStartServer = $startServer; - if ( isset( $serverPort ) ) + } + + if ( isset( $serverPort ) ) { $this->SeleniumServerPort = $serverPort; - if ( isset( $serverExecPath ) ) + } + + if ( isset( $serverExecPath ) ) { $this->SeleniumServerExecPath = $serverExecPath; + } + return; } @@ -66,7 +73,9 @@ class SeleniumServerManager { // to true, since after server is started, it is shut down by stop(). public function setSeleniumStartServer( $startServer ) { - if ( $startServer == true ) $this->SeleniumStartServer = true; + if ( $startServer == true ) { + $this->SeleniumStartServer = true; + } } // return values are: 1) started - server started, 2) failed - @@ -75,7 +84,9 @@ class SeleniumServerManager { public function start() { - if ( !$this->SeleniumStartServer ) return 'failed'; + if ( !$this->SeleniumStartServer ) { + return 'failed'; + } // commented out cases are untested @@ -142,15 +153,15 @@ class SeleniumServerManager { $output = array(); $user = $_ENV['USER']; // @todo FIXME: This should be a little more generalized :) - if (PHP_OS == 'Darwin') { + if ( PHP_OS == 'Darwin' ) { // Mac OS X's ps barfs on the 'w' param, but doesn't need it. $ps = "ps -U %s"; } else { // Good on Linux $ps = "ps -U %s w"; } - $psCommand = sprintf($ps, escapeshellarg($user)); - exec($psCommand . " | grep -i selenium-server", $output); + $psCommand = sprintf( $ps, escapeshellarg( $user ) ); + exec( $psCommand . " | grep -i selenium-server", $output ); // Start server. If there is already a server running, // return running. @@ -170,16 +181,16 @@ class SeleniumServerManager { // The echo guarentees it is put into $op when // the exec command is run. - $commandSuffix = ' > /dev/null 2>&1'. ' & echo $!'; + $commandSuffix = ' > /dev/null 2>&1' . ' & echo $!'; $portText = ' -port ' . $this->SeleniumServerPort; $command = "java -jar " . - escapeshellarg($this->SeleniumServerExecPath) . + escapeshellarg( $this->SeleniumServerExecPath ) . $portText . $commandSuffix; - exec($command ,$op); + exec( $command, $op ); $pid = (int)$op[0]; - if ( $pid != "" ) + if ( $pid != "" ) { $this->SeleniumServerPid = $pid; - else { + } else { $this->SeleniumServerPid = 'NaN'; // Server start failed. return 'failed'; @@ -192,27 +203,29 @@ class SeleniumServerManager { for ( $cnt = 1; $cnt <= $this->SeleniumServerStartTimeout; $cnt++ ) { - $fp = fsockopen ( 'localhost', + $fp = fsockopen( 'localhost', $this->SeleniumServerPort, $errno, $errstr, 0 ); if ( !$fp ) { sleep( 1 ); continue; - // Server start succeeded. + // Server start succeeded. } else { - fclose ( $fp ); + fclose( $fp ); return 'started'; } } wfRestoreWarnings(); echo ( "Starting Selenium server timed out.\n" ); return 'failed'; + } else { + // server already running. + return 'running'; } - // server already running. - else return 'running'; } - // No Server execution path defined. + + // No Server execution path defined. return 'failed'; } @@ -224,11 +237,13 @@ class SeleniumServerManager { private function stopServerOnUnix() { if ( !empty( $this->SeleniumServerPid ) && - $this->SeleniumServerPid != 'NaN' ) { + $this->SeleniumServerPid != 'NaN' + ) { exec( "kill -9 " . $this->SeleniumServerPid ); return 'stopped'; + } else { + return 'failed'; } - else return 'failed'; } private function stopServerOnWindows() { diff --git a/tests/selenium/SeleniumTestCase.php b/tests/selenium/SeleniumTestCase.php index 7976c16a0b..5346b1be80 100644 --- a/tests/selenium/SeleniumTestCase.php +++ b/tests/selenium/SeleniumTestCase.php @@ -1,5 +1,5 @@ type( SeleniumTestConstants::INPUT_SEARCH_BOX, $pageName ); + $this->type( SeleniumTestConstants::INPUT_SEARCH_BOX, $pageName ); $this->click( SeleniumTestConstants::BUTTON_SEARCH ); $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); $this->click( SeleniumTestConstants::LINK_START . $pageName ); $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); - $location = $this->getLocation() . "\n"; - if ( strpos( $location, '&redlink=1') !== false ) { - $this->type( SeleniumTestConstants::TEXT_EDITOR, "Test fixture page. No real content here" ); + $location = $this->getLocation() . "\n"; + if ( strpos( $location, '&redlink=1' ) !== false ) { + $this->type( SeleniumTestConstants::TEXT_EDITOR, "Test fixture page. No real content here" ); $this->click( SeleniumTestConstants::BUTTON_SAVE ); $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); $this->assertTrue( $this->isTextPresent( $pageName ), - $this->getText( SeleniumTestConstants::TEXT_PAGE_HEADING ) ); + $this->getText( SeleniumTestConstants::TEXT_PAGE_HEADING ) ); } } - + /** * Create a test page using date as part of the name so that it is unique * @param $pagePrefix The prefix to use for the page name. The current date will be appended to this to make it unique * @param $watchThis Whether to add the page to my watchlist. Defaults to false. */ function createNewTestPage( $pagePrefix, $watchThis = false ) { - $pageName = $pagePrefix . date("Ymd-His"); - $this->type( SeleniumTestConstants::INPUT_SEARCH_BOX, $pageName ); + $pageName = $pagePrefix . date( "Ymd-His" ); + $this->type( SeleniumTestConstants::INPUT_SEARCH_BOX, $pageName ); $this->click( SeleniumTestConstants::BUTTON_SEARCH ); $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); $this->click( SeleniumTestConstants::LINK_START . $pageName ); $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); - $location = $this->getLocation() . "\n"; - $this->assertContains( '&redlink=1', $location ). - $this->type( SeleniumTestConstants::TEXT_EDITOR, "Test fixture page. No real content here" ); + $location = $this->getLocation() . "\n"; + $this->assertContains( '&redlink=1', $location ) . + $this->type( SeleniumTestConstants::TEXT_EDITOR, "Test fixture page. No real content here" ); if ( $watchThis ) { $this->click( "wpWatchthis" ); } $this->click( SeleniumTestConstants::BUTTON_SAVE ); $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); $this->assertTrue( $this->isTextPresent( $pageName ), - $this->getText( SeleniumTestConstants::TEXT_PAGE_HEADING ) ); + $this->getText( SeleniumTestConstants::TEXT_PAGE_HEADING ) ); return $pageName; } - public function getExistingPage(){ + public function getExistingPage() { $this->open( $this->getUrl() . '/index.php?title=Main_Page&action=edit' ); - $this->type("searchInput", "new" ); - $this->click("searchGoButton"); - $this->waitForPageToLoad("30000"); + $this->type( "searchInput", "new" ); + $this->click( "searchGoButton" ); + $this->waitForPageToLoad( "30000" ); } - public function getNewPage($pageName){ + public function getNewPage( $pageName ) { $this->open( $this->getUrl() . '/index.php?title=Main_Page&action=edit' ); - $this->type("searchInput", $pageName ); - $this->click("searchGoButton"); - $this->waitForPageToLoad("30000"); - $this->click("link=".$pageName); - $this->waitForPageToLoad("600000"); + $this->type( "searchInput", $pageName ); + $this->click( "searchGoButton" ); + $this->waitForPageToLoad( "30000" ); + $this->click( "link=" . $pageName ); + $this->waitForPageToLoad( "600000" ); } + // Loading the mediawiki editor - public function loadWikiEditor(){ + public function loadWikiEditor() { $this->open( $this->getUrl() . '/index.php?title=Main_Page&action=edit' ); } // Clear the content of the mediawiki editor - public function clearWikiEditor(){ - $this->type("wpTextbox1", ""); + public function clearWikiEditor() { + $this->type( "wpTextbox1", "" ); } // Click on the 'Show preview' button of the mediawiki editor - public function clickShowPreviewBtn(){ - $this->click("wpPreview"); + public function clickShowPreviewBtn() { + $this->click( "wpPreview" ); } // Click on the 'Save Page' button of the mediawiki editor - public function clickSavePageBtn(){ - $this->click("wpSave"); + public function clickSavePageBtn() { + $this->click( "wpSave" ); } // Click on the 'Edit' link - public function clickEditLink(){ - $this->click("link=Edit"); - $this->waitForPageToLoad("30000"); + public function clickEditLink() { + $this->click( "link=Edit" ); + $this->waitForPageToLoad( "30000" ); } - } diff --git a/tests/selenium/installer/MediaWikiButtonsAvailabilityTestCase.php b/tests/selenium/installer/MediaWikiButtonsAvailabilityTestCase.php index 8bca4b0db6..341b316159 100644 --- a/tests/selenium/installer/MediaWikiButtonsAvailabilityTestCase.php +++ b/tests/selenium/installer/MediaWikiButtonsAvailabilityTestCase.php @@ -28,75 +28,69 @@ */ -require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php'); +require_once ( __DIR__ . '/' . 'MediaWikiInstallationCommonFunction.php' ); /** * Test Case ID : 30 (http://www.mediawiki.org/wiki/New_installer/Test_plan) * Test Case Name :'Back' and 'Continue' button availability * Version : MediaWiki 1.18alpha -*/ - + */ class MediaWikiButtonsAvailabilityTestCase extends MediaWikiInstallationCommonFunction { - - function setUp() { - parent::setUp(); - } - - - // Verify only 'Continue' button available on 'Language' page - public function testOnlyContinueButtonAvailability() { - - parent::navigateLanguagePage(); - - // Verify only 'Continue' button avaialble - $this->assertTrue( $this->isElementPresent( "submit-continue" )); - - // 'Back' button is not avaialble - $this->assertElementNotPresent( "submit-back" ); - } - - - // Verify 'Continue' and 'Back' buttons availability - public function testBothButtonsAvailability() { - - // Verify buttons availability on 'Welcome to MediaWiki' page - parent::navigateWelcometoMediaWikiPage(); - $this->assertTrue( $this->isElementPresent( "submit-back" )); - $this->assertTrue( $this->isElementPresent( "submit-continue" )); - parent::restartInstallation(); - - // Verify buttons availability on 'Connect to Database' page - parent::navigateConnetToDatabasePage(); - $this->assertTrue( $this->isElementPresent( "submit-back" )); - $this->assertTrue( $this->isElementPresent( "submit-continue" )); - parent::restartInstallation(); - - // Verify buttons availability on 'Database settings' page - $databaseName = DB_NAME_PREFIX."_db_settings"; - parent::navigateDatabaseSettingsPage( $databaseName ); - $this->assertTrue( $this->isElementPresent( "submit-back" )); - $this->assertTrue( $this->isElementPresent( "submit-continue" )); - parent::restartInstallation(); - - // Verify buttons availability on 'Name' page - $databaseName = DB_NAME_PREFIX."_name"; - parent::navigateNamePage( $databaseName ); - $this->assertTrue( $this->isElementPresent( "submit-back" )); - $this->assertTrue( $this->isElementPresent( "submit-continue" )); - parent::restartInstallation(); - - // Verify buttons availability on 'Options' page - $databaseName = DB_NAME_PREFIX."_options"; - parent::navigateOptionsPage( $databaseName ); - $this->assertTrue( $this->isElementPresent( "submit-back" )); - $this->assertTrue( $this->isElementPresent( "submit-continue" )); - parent::restartInstallation(); - - // Verify buttons availability on 'Install' page - $databaseName = DB_NAME_PREFIX."_install"; - parent::navigateInstallPage($databaseName); - $this->assertTrue( $this->isElementPresent( "submit-back" )); - $this->assertTrue( $this->isElementPresent( "submit-continue" )); - } + function setUp() { + parent::setUp(); + } + + // Verify only 'Continue' button available on 'Language' page + public function testOnlyContinueButtonAvailability() { + parent::navigateLanguagePage(); + + // Verify only 'Continue' button avaialble + $this->assertTrue( $this->isElementPresent( "submit-continue" ) ); + + // 'Back' button is not avaialble + $this->assertElementNotPresent( "submit-back" ); + } + + // Verify 'Continue' and 'Back' buttons availability + public function testBothButtonsAvailability() { + // Verify buttons availability on 'Welcome to MediaWiki' page + parent::navigateWelcometoMediaWikiPage(); + $this->assertTrue( $this->isElementPresent( "submit-back" ) ); + $this->assertTrue( $this->isElementPresent( "submit-continue" ) ); + parent::restartInstallation(); + + // Verify buttons availability on 'Connect to Database' page + parent::navigateConnetToDatabasePage(); + $this->assertTrue( $this->isElementPresent( "submit-back" ) ); + $this->assertTrue( $this->isElementPresent( "submit-continue" ) ); + parent::restartInstallation(); + + // Verify buttons availability on 'Database settings' page + $databaseName = DB_NAME_PREFIX . "_db_settings"; + parent::navigateDatabaseSettingsPage( $databaseName ); + $this->assertTrue( $this->isElementPresent( "submit-back" ) ); + $this->assertTrue( $this->isElementPresent( "submit-continue" ) ); + parent::restartInstallation(); + + // Verify buttons availability on 'Name' page + $databaseName = DB_NAME_PREFIX . "_name"; + parent::navigateNamePage( $databaseName ); + $this->assertTrue( $this->isElementPresent( "submit-back" ) ); + $this->assertTrue( $this->isElementPresent( "submit-continue" ) ); + parent::restartInstallation(); + + // Verify buttons availability on 'Options' page + $databaseName = DB_NAME_PREFIX . "_options"; + parent::navigateOptionsPage( $databaseName ); + $this->assertTrue( $this->isElementPresent( "submit-back" ) ); + $this->assertTrue( $this->isElementPresent( "submit-continue" ) ); + parent::restartInstallation(); + + // Verify buttons availability on 'Install' page + $databaseName = DB_NAME_PREFIX . "_install"; + parent::navigateInstallPage( $databaseName ); + $this->assertTrue( $this->isElementPresent( "submit-back" ) ); + $this->assertTrue( $this->isElementPresent( "submit-continue" ) ); + } } diff --git a/tests/selenium/installer/MediaWikiDifferentDatabaseAccountTestCase.php b/tests/selenium/installer/MediaWikiDifferentDatabaseAccountTestCase.php index 8e2afe7305..76a794c07f 100644 --- a/tests/selenium/installer/MediaWikiDifferentDatabaseAccountTestCase.php +++ b/tests/selenium/installer/MediaWikiDifferentDatabaseAccountTestCase.php @@ -34,49 +34,46 @@ require_once ( __DIR__ . '/MediaWikiInstallationCommonFunction.php' ); * Test Case ID : 04 (http://www.mediawiki.org/wiki/New_installer/Test_plan) * Test Case Name : Install MediaWiki with different Database accounts for web access. * Version : MediaWiki 1.18alpha -*/ + */ class MediaWikiDifferentDatabaseAccountTestCase extends MediaWikiInstallationCommonFunction { + function setUp() { + parent::setUp(); + } - function setUp() { - parent::setUp(); - } - - - // Install Mediawiki using 'MySQL' database type. - public function testDifferentDatabaseAccount() { - - $databaseName = DB_NAME_PREFIX."_dif_accounts"; + // Install Mediawiki using 'MySQL' database type. + public function testDifferentDatabaseAccount() { + $databaseName = DB_NAME_PREFIX . "_dif_accounts"; - // Navigate to the 'Database settings' page - parent::navigateDatabaseSettingsPage( $databaseName ); + // Navigate to the 'Database settings' page + parent::navigateDatabaseSettingsPage( $databaseName ); - // Click on the 'Use the same account as for installation' check box - $this->click( "mysql__SameAccount" ); + // Click on the 'Use the same account as for installation' check box + $this->click( "mysql__SameAccount" ); - // Change the 'Database username' - $this->type( "mysql_wgDBuser", DB_WEB_USER ); + // Change the 'Database username' + $this->type( "mysql_wgDBuser", DB_WEB_USER ); - // Enter 'Database password:' - $this->type( "mysql_wgDBpassword", DB_WEB_USER_PASSWORD ); + // Enter 'Database password:' + $this->type( "mysql_wgDBpassword", DB_WEB_USER_PASSWORD ); - // Select 'Create the account if it does not already exist' check box - $this->click( "mysql__CreateDBAccount" ); - parent::clickContinueButton(); + // Select 'Create the account if it does not already exist' check box + $this->click( "mysql__CreateDBAccount" ); + parent::clickContinueButton(); - // 'Name' page - parent::completeNamePage(); + // 'Name' page + parent::completeNamePage(); - // 'Options' page - parent::clickContinueButton(); + // 'Options' page + parent::clickContinueButton(); - // 'Install' page - $this->assertEquals("Creating database user... done", - $this->getText( LINK_FORM."ul/li[3]")); - parent::clickContinueButton(); + // 'Install' page + $this->assertEquals( "Creating database user... done", + $this->getText( LINK_FORM . "ul/li[3]" ) ); + parent::clickContinueButton(); - // 'Complete' page - parent::completePageSuccessfull(); - $this->chooseCancelOnNextConfirmation(); - } + // 'Complete' page + parent::completePageSuccessfull(); + $this->chooseCancelOnNextConfirmation(); + } } diff --git a/tests/selenium/installer/MediaWikiDifferntDatabasePrefixTestCase.php b/tests/selenium/installer/MediaWikiDifferntDatabasePrefixTestCase.php index 55ad4612b1..2c879c3d5f 100644 --- a/tests/selenium/installer/MediaWikiDifferntDatabasePrefixTestCase.php +++ b/tests/selenium/installer/MediaWikiDifferntDatabasePrefixTestCase.php @@ -34,62 +34,60 @@ require_once ( __DIR__ . '/MediaWikiInstallationCommonFunction.php' ); * Test Case Name : Install MediaWiki with the same database and the different * database prefixes(Share one database between multiple wikis). * Version : MediaWiki 1.18alpha -*/ + */ class MediaWikiDifferntDatabasePrefixTestCase extends MediaWikiInstallationCommonFunction { + function setUp() { + parent::setUp(); + } - function setUp() { - parent::setUp(); - } - - // Install Mediawiki using 'MySQL' database type. - public function testDifferentDatabasePrefix() { - - $databaseName = DB_NAME_PREFIX."_db_prefix"; - parent::navigateInstallPage( $databaseName ); + // Install Mediawiki using 'MySQL' database type. + public function testDifferentDatabasePrefix() { + $databaseName = DB_NAME_PREFIX . "_db_prefix"; + parent::navigateInstallPage( $databaseName ); - // To 'Options' page - parent::clickBackButton(); + // To 'Options' page + parent::clickBackButton(); - // To 'Name' page - parent::clickBackButton(); + // To 'Name' page + parent::clickBackButton(); - // To 'Database settings' page - parent::clickBackButton(); + // To 'Database settings' page + parent::clickBackButton(); - // To 'Connect to database' page - parent::clickBackButton(); + // To 'Connect to database' page + parent::clickBackButton(); - // From 'Connect to database' page without database prefix - parent::clickContinueButton(); + // From 'Connect to database' page without database prefix + parent::clickContinueButton(); - // Verify upgrade existing message - $this->assertEquals( "Upgrade existing installation", - $this->getText( LINK_DIV."h2" )); + // Verify upgrade existing message + $this->assertEquals( "Upgrade existing installation", + $this->getText( LINK_DIV . "h2" ) ); - // To 'Connect to database' page - parent::clickBackButton(); + // To 'Connect to database' page + parent::clickBackButton(); - // Input the database prefix - $this->type( "mysql_wgDBprefix", DATABASE_PREFIX ); + // Input the database prefix + $this->type( "mysql_wgDBprefix", DATABASE_PREFIX ); - // From 'Connect to database' page with database prefix - parent::clickContinueButton(); + // From 'Connect to database' page with database prefix + parent::clickContinueButton(); - // To 'Complete' page - parent::clickContinueButton(); - parent::completeNamePage(); - parent::clickContinueButton(); + // To 'Complete' page + parent::clickContinueButton(); + parent::completeNamePage(); + parent::clickContinueButton(); - // Verify already installed warning message - $this->assertEquals( "Install", - $this->getText( LINK_DIV."h2" )); - $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again. Please proceed to the next page.", - $this->getText( LINK_FORM."div[1]" )); + // Verify already installed warning message + $this->assertEquals( "Install", + $this->getText( LINK_DIV . "h2" ) ); + $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again. Please proceed to the next page.", + $this->getText( LINK_FORM . "div[1]" ) ); - parent::clickContinueButton(); - parent::completePageSuccessfull(); - $this->chooseCancelOnNextConfirmation(); - parent::restartInstallation(); - } + parent::clickContinueButton(); + parent::completePageSuccessfull(); + $this->chooseCancelOnNextConfirmation(); + parent::restartInstallation(); + } } diff --git a/tests/selenium/installer/MediaWikiMySQLDataBaseTestCase.php b/tests/selenium/installer/MediaWikiMySQLDataBaseTestCase.php index 16d065c769..d631ed83c5 100644 --- a/tests/selenium/installer/MediaWikiMySQLDataBaseTestCase.php +++ b/tests/selenium/installer/MediaWikiMySQLDataBaseTestCase.php @@ -27,52 +27,49 @@ * */ - -require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php'); +require_once ( __DIR__ . '/' . 'MediaWikiInstallationCommonFunction.php' ); /** * Test Case ID : 01 (http://www.mediawiki.org/wiki/New_installer/Test_plan) * Test Case Name : Install Mediawiki using 'MySQL' database type successfully * Version : MediaWiki 1.18alpha -*/ + */ class MediaWikiMySQLDataBaseTestCase extends MediaWikiInstallationCommonFunction { + function setUp() { + parent::setUp(); + } - function setUp() { - parent::setUp(); - } - - // Verify MediaWiki installation using 'MySQL' database type - public function testMySQLDatabaseSuccess() { - - $databaseName = DB_NAME_PREFIX."_sql_db"; + // Verify MediaWiki installation using 'MySQL' database type + public function testMySQLDatabaseSuccess() { + $databaseName = DB_NAME_PREFIX . "_sql_db"; - parent::navigateConnetToDatabasePage(); + parent::navigateConnetToDatabasePage(); - // Verify 'MySQL" is selected as the default database type - $this->assertEquals( "MySQL settings", $this->getText( "//div[@id='DB_wrapper_mysql']/h3" )); + // Verify 'MySQL" is selected as the default database type + $this->assertEquals( "MySQL settings", $this->getText( "//div[@id='DB_wrapper_mysql']/h3" ) ); - // Change 'Database name' - $defaultDbName = $this->getText( "mysql_wgDBname" ); - $this->type( "mysql_wgDBname", " "); - $this->type( "mysql_wgDBname", $databaseName ); - $this->assertNotEquals( $defaultDbName, $databaseName ); + // Change 'Database name' + $defaultDbName = $this->getText( "mysql_wgDBname" ); + $this->type( "mysql_wgDBname", " " ); + $this->type( "mysql_wgDBname", $databaseName ); + $this->assertNotEquals( $defaultDbName, $databaseName ); - // 'Database settings' page - parent::clickContinueButton(); + // 'Database settings' page + parent::clickContinueButton(); - // 'Name' page - parent::clickContinueButton(); - parent::completeNamePage(); + // 'Name' page + parent::clickContinueButton(); + parent::completeNamePage(); - // 'Options page - parent::clickContinueButton(); + // 'Options page + parent::clickContinueButton(); - // 'Install' page - parent::clickContinueButton(); + // 'Install' page + parent::clickContinueButton(); - // 'Complete' page - parent::completePageSuccessfull(); - parent::restartInstallation(); - } + // 'Complete' page + parent::completePageSuccessfull(); + parent::restartInstallation(); + } } diff --git a/tests/selenium/installer/MediaWikiMySQLiteDataBaseTestCase.php b/tests/selenium/installer/MediaWikiMySQLiteDataBaseTestCase.php index 4ca6916254..19c05da75a 100644 --- a/tests/selenium/installer/MediaWikiMySQLiteDataBaseTestCase.php +++ b/tests/selenium/installer/MediaWikiMySQLiteDataBaseTestCase.php @@ -28,52 +28,50 @@ */ -require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php'); +require_once ( __DIR__ . '/' . 'MediaWikiInstallationCommonFunction.php' ); /** * Test Case ID : 06 (http://www.mediawiki.org/wiki/New_installer/Test_plan) * Test Case Name : Install Mediawiki using 'MySQL' database type successfully * Version : MediaWiki 1.18alpha -*/ + */ class MediaWikiMySQLiteDataBaseTestCase extends MediaWikiInstallationCommonFunction { + function setUp() { + parent::setUp(); + } - function setUp() { - parent::setUp(); - } - - // Verify MediaWiki installation using 'MySQL' database type - public function testMySQLDatabaseSuccess() { - - $databaseName = DB_NAME_PREFIX."_sqlite_db"; + // Verify MediaWiki installation using 'MySQL' database type + public function testMySQLDatabaseSuccess() { + $databaseName = DB_NAME_PREFIX . "_sqlite_db"; - parent::navigateConnetToDatabasePage(); - $this->click( "DBType_sqlite" ); + parent::navigateConnetToDatabasePage(); + $this->click( "DBType_sqlite" ); - // Select 'SQLite' database type - $this->assertEquals( "SQLite settings", $this->getText( "//div[@id='DB_wrapper_sqlite']/h3" )); + // Select 'SQLite' database type + $this->assertEquals( "SQLite settings", $this->getText( "//div[@id='DB_wrapper_sqlite']/h3" ) ); - // Change database name - $defaultDbName = $this->getText( "sqlite_wgDBname" ); - $this->type( "sqlite_wgDBname", " "); - $this->type( "sqlite_wgDBname", $databaseName ); - $this->assertNotEquals( $defaultDbName, $databaseName ); + // Change database name + $defaultDbName = $this->getText( "sqlite_wgDBname" ); + $this->type( "sqlite_wgDBname", " " ); + $this->type( "sqlite_wgDBname", $databaseName ); + $this->assertNotEquals( $defaultDbName, $databaseName ); - // 'Database settings' page - parent::clickContinueButton(); + // 'Database settings' page + parent::clickContinueButton(); - // 'Name' page - parent::clickContinueButton(); - parent::completeNamePage(); + // 'Name' page + parent::clickContinueButton(); + parent::completeNamePage(); - // 'Options page - parent::clickContinueButton(); + // 'Options page + parent::clickContinueButton(); - // 'Install' page - parent::clickContinueButton(); + // 'Install' page + parent::clickContinueButton(); - // 'Complete' page - parent::completePageSuccessfull(); - parent::restartInstallation(); - } + // 'Complete' page + parent::completePageSuccessfull(); + parent::restartInstallation(); + } } diff --git a/tests/selenium/installer/MediaWikiOnAlreadyInstalledTestCase.php b/tests/selenium/installer/MediaWikiOnAlreadyInstalledTestCase.php index 7a1b615cb7..21c4578b7f 100644 --- a/tests/selenium/installer/MediaWikiOnAlreadyInstalledTestCase.php +++ b/tests/selenium/installer/MediaWikiOnAlreadyInstalledTestCase.php @@ -28,44 +28,42 @@ */ -require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php'); +require_once ( __DIR__ . '/' . 'MediaWikiInstallationCommonFunction.php' ); /** * Test Case ID : 03 (http://www.mediawiki.org/wiki/New_installer/Test_plan) * Test Case Name : Install mediawiki on a already installed Mediawiki.] * Version : MediaWiki 1.18alpha -*/ + */ class MediaWikiOnAlreadyInstalledTestCase extends MediaWikiInstallationCommonFunction { + function setUp() { + parent::setUp(); + } - function setUp() { - parent::setUp(); - } - - // Install Mediawiki using 'MySQL' database type. - public function testInstallOnAlreadyInstalled() { - - $databaseName = DB_NAME_PREFIX."_already_installed"; - parent::navigateInstallPage( $databaseName ); + // Install Mediawiki using 'MySQL' database type. + public function testInstallOnAlreadyInstalled() { + $databaseName = DB_NAME_PREFIX . "_already_installed"; + parent::navigateInstallPage( $databaseName ); - // 'Options' page - parent::clickBackButton(); + // 'Options' page + parent::clickBackButton(); - // Install page - parent::clickContinueButton(); + // Install page + parent::clickContinueButton(); - // 'Install' page should display after the 'Option' page - $this->assertEquals( "Install", $this->getText( LINK_DIV."h2" )); + // 'Install' page should display after the 'Option' page + $this->assertEquals( "Install", $this->getText( LINK_DIV . "h2" ) ); - // Verify warning text displayed - $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again. Please proceed to the next page.", - $this->getText( LINK_FORM."div[1]/div[2]" )); + // Verify warning text displayed + $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again. Please proceed to the next page.", + $this->getText( LINK_FORM . "div[1]/div[2]" ) ); - // Complete page - parent::clickContinueButton(); - parent::completePageSuccessfull(); - $this->chooseCancelOnNextConfirmation(); - parent::restartInstallation(); - } + // Complete page + parent::clickContinueButton(); + parent::completePageSuccessfull(); + $this->chooseCancelOnNextConfirmation(); + parent::restartInstallation(); + } } diff --git a/tests/selenium/installer/MediaWikiRestartInstallationTestCase.php b/tests/selenium/installer/MediaWikiRestartInstallationTestCase.php index ea87de0838..2acb4df6a3 100644 --- a/tests/selenium/installer/MediaWikiRestartInstallationTestCase.php +++ b/tests/selenium/installer/MediaWikiRestartInstallationTestCase.php @@ -28,88 +28,83 @@ */ - -require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php'); +require_once ( __DIR__ . '/' . 'MediaWikiInstallationCommonFunction.php' ); /** * Test Case ID : 11, 12 (http://www.mediawiki.org/wiki/New_installer/Test_plan) * Test Case Name : Install mediawiki on a already installed Mediawiki. * Version : MediaWiki 1.18alpha -*/ + */ class MediaWikiRestartInstallationTestCase extends MediaWikiInstallationCommonFunction { + function setUp() { + parent::setUp(); + } - function setUp() { - parent::setUp(); - } - - // Verify restarting the installation - public function testSuccessRestartInstallation() { - - $dbNameBeforeRestart = DB_NAME_PREFIX."_db_before"; - parent::navigateDatabaseSettingsPage( $dbNameBeforeRestart ); - - // Verify 'Restart installation' link available - $this->assertTrue($this->isElementPresent( "link=Restart installation" )); - - // Click 'Restart installation' - $this->click( "link=Restart installation "); - $this->waitForPageToLoad( PAGE_LOAD_TIME ); + // Verify restarting the installation + public function testSuccessRestartInstallation() { + $dbNameBeforeRestart = DB_NAME_PREFIX . "_db_before"; + parent::navigateDatabaseSettingsPage( $dbNameBeforeRestart ); - // 'Restart Installation' page displayed - $this->assertEquals( "Restart installation", $this->getText( LINK_DIV."h2")); + // Verify 'Restart installation' link available + $this->assertTrue( $this->isElementPresent( "link=Restart installation" ) ); - // Restart warning message displayed - $this->assertTrue($this->isTextPresent( "exact:Do you want to clear all saved data that you have entered and restart the installation process?" )); + // Click 'Restart installation' + $this->click( "link=Restart installation " ); + $this->waitForPageToLoad( PAGE_LOAD_TIME ); - // Click on the 'Yes, restart' button - $this->click( "submit-restart" ); - $this->waitForPageToLoad( PAGE_LOAD_TIME ); + // 'Restart Installation' page displayed + $this->assertEquals( "Restart installation", $this->getText( LINK_DIV . "h2" ) ); - // Navigate to the initial installation page(Language). - $this->assertEquals( "Language", $this->getText( LINK_DIV."h2" )); + // Restart warning message displayed + $this->assertTrue( $this->isTextPresent( "exact:Do you want to clear all saved data that you have entered and restart the installation process?" ) ); - // 'Welcome to MediaWiki!' page - parent::clickContinueButton(); + // Click on the 'Yes, restart' button + $this->click( "submit-restart" ); + $this->waitForPageToLoad( PAGE_LOAD_TIME ); - // 'Connect to database' page - parent::clickContinueButton(); + // Navigate to the initial installation page(Language). + $this->assertEquals( "Language", $this->getText( LINK_DIV . "h2" ) ); - // saved data should be deleted - $dbNameAfterRestart = $this->getValue("mysql_wgDBname"); - $this->assertNotEquals($dbNameBeforeRestart, $dbNameAfterRestart); - } + // 'Welcome to MediaWiki!' page + parent::clickContinueButton(); + // 'Connect to database' page + parent::clickContinueButton(); - // Verify cancelling restart - public function testCancelRestartInstallation() { + // saved data should be deleted + $dbNameAfterRestart = $this->getValue( "mysql_wgDBname" ); + $this->assertNotEquals( $dbNameBeforeRestart, $dbNameAfterRestart ); + } - $dbNameBeforeRestart = DB_NAME_PREFIX."_cancel_restart"; + // Verify cancelling restart + public function testCancelRestartInstallation() { + $dbNameBeforeRestart = DB_NAME_PREFIX . "_cancel_restart"; - parent::navigateDatabaseSettingsPage( $dbNameBeforeRestart); - // Verify 'Restart installation' link available - $this->assertTrue($this->isElementPresent( "link=Restart installation" )); + parent::navigateDatabaseSettingsPage( $dbNameBeforeRestart ); + // Verify 'Restart installation' link available + $this->assertTrue( $this->isElementPresent( "link=Restart installation" ) ); - $this->click( "link=Restart installation" ); - $this->waitForPageToLoad( PAGE_LOAD_TIME ); + $this->click( "link=Restart installation" ); + $this->waitForPageToLoad( PAGE_LOAD_TIME ); - // 'Restart Installation' page displayed - $this->assertEquals( "Restart installation", $this->getText( LINK_DIV."h2" )); + // 'Restart Installation' page displayed + $this->assertEquals( "Restart installation", $this->getText( LINK_DIV . "h2" ) ); - // Restart warning message displayed - $this->assertTrue( $this->isTextPresent( "Do you want to clear all saved data that you have entered and restart the installation process?")); + // Restart warning message displayed + $this->assertTrue( $this->isTextPresent( "Do you want to clear all saved data that you have entered and restart the installation process?" ) ); - // Click on the 'Back' button - parent::clickBackButton(); + // Click on the 'Back' button + parent::clickBackButton(); - // Navigates to the previous page - $this->assertEquals( "Database settings", $this->getText( LINK_DIV."h2" )); + // Navigates to the previous page + $this->assertEquals( "Database settings", $this->getText( LINK_DIV . "h2" ) ); - // 'Connect to database' page - parent::clickBackButton(); + // 'Connect to database' page + parent::clickBackButton(); - // Saved data remain on the page. - $dbNameAfterRestart = $this->getValue( "mysql_wgDBname" ); - $this->assertEquals( $dbNameBeforeRestart, $dbNameAfterRestart ); - } + // Saved data remain on the page. + $dbNameAfterRestart = $this->getValue( "mysql_wgDBname" ); + $this->assertEquals( $dbNameBeforeRestart, $dbNameAfterRestart ); + } } diff --git a/tests/selenium/installer/MediaWikiRightFrameworkLinksTestCase.php b/tests/selenium/installer/MediaWikiRightFrameworkLinksTestCase.php index 7b0fcf369d..63491c7970 100644 --- a/tests/selenium/installer/MediaWikiRightFrameworkLinksTestCase.php +++ b/tests/selenium/installer/MediaWikiRightFrameworkLinksTestCase.php @@ -27,8 +27,7 @@ * */ - -require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php'); +require_once ( __DIR__ . '/' . 'MediaWikiInstallationCommonFunction.php' ); /** * Test Case ID : 14, 15, 16, 17 (http://www.mediawiki.org/wiki/New_installer/Test_plan) @@ -37,57 +36,53 @@ require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php'); * User selects 'Copying' link. * User selects 'Upgrading' link. * Version : MediaWiki 1.18alpha -*/ - + */ class MediaWikiRightFrameworkLinksTestCase extends MediaWikiInstallationCommonFunction { - - function setUp() { - parent::setUp(); - } - - public function testLinksAvailability() { - - $this->open( "http://".HOST_NAME.":".PORT."/".DIRECTORY_NAME."/config/index.php" ); - - // Verify 'Read me' link availability - $this->assertTrue($this->isElementPresent( "link=Read me" )); - - // Verify 'Release notes' link availability - $this->assertTrue($this->isElementPresent( "link=Release notes" )); - - // Verify 'Copying' link availability - $this->assertTrue($this->isElementPresent( "link=Copying" )); - } - - public function testPageNavigation() { - - $this->open( "http://".HOST_NAME.":".PORT."/".DIRECTORY_NAME."/config/index.php" ); - - // Navigate to the 'Read me' page - $this->click( "link=Read me" ); - $this->waitForPageToLoad( PAGE_LOAD_TIME ); - $this->assertEquals( "Read me", $this->getText( LINK_DIV."h2[1]" )); - $this->assertTrue($this->isElementPresent( "submit-back" )); - parent::clickBackButton(); - - // Navigate to the 'Release notes' page - $this->click( "link=Release notes" ); - $this->waitForPageToLoad( PAGE_LOAD_TIME); - $this->assertEquals( "Release notes", $this->getText( LINK_DIV."h2[1]" )); - $this->assertTrue( $this->isElementPresent( "submit-back" )); - parent::clickBackButton(); - - // Navigate to the 'Copying' page - $this->click( "link=Copying" ); - $this->waitForPageToLoad( PAGE_LOAD_TIME ); - $this->assertEquals( "Copying", $this->getText( LINK_DIV."h2[1]" )); - $this->assertTrue($this->isElementPresent( "submit-back" )); - parent::clickBackButton(); - - // Navigate to the 'Upgrading' page - $this->click( "link=Upgrading" ); - $this->waitForPageToLoad( PAGE_LOAD_TIME ); - $this->assertEquals( "Upgrading", $this->getText( LINK_DIV."h2[1]" )); - } + function setUp() { + parent::setUp(); + } + + public function testLinksAvailability() { + $this->open( "http://" . HOST_NAME . ":" . PORT . "/" . DIRECTORY_NAME . "/config/index.php" ); + + // Verify 'Read me' link availability + $this->assertTrue( $this->isElementPresent( "link=Read me" ) ); + + // Verify 'Release notes' link availability + $this->assertTrue( $this->isElementPresent( "link=Release notes" ) ); + + // Verify 'Copying' link availability + $this->assertTrue( $this->isElementPresent( "link=Copying" ) ); + } + + public function testPageNavigation() { + $this->open( "http://" . HOST_NAME . ":" . PORT . "/" . DIRECTORY_NAME . "/config/index.php" ); + + // Navigate to the 'Read me' page + $this->click( "link=Read me" ); + $this->waitForPageToLoad( PAGE_LOAD_TIME ); + $this->assertEquals( "Read me", $this->getText( LINK_DIV . "h2[1]" ) ); + $this->assertTrue( $this->isElementPresent( "submit-back" ) ); + parent::clickBackButton(); + + // Navigate to the 'Release notes' page + $this->click( "link=Release notes" ); + $this->waitForPageToLoad( PAGE_LOAD_TIME ); + $this->assertEquals( "Release notes", $this->getText( LINK_DIV . "h2[1]" ) ); + $this->assertTrue( $this->isElementPresent( "submit-back" ) ); + parent::clickBackButton(); + + // Navigate to the 'Copying' page + $this->click( "link=Copying" ); + $this->waitForPageToLoad( PAGE_LOAD_TIME ); + $this->assertEquals( "Copying", $this->getText( LINK_DIV . "h2[1]" ) ); + $this->assertTrue( $this->isElementPresent( "submit-back" ) ); + parent::clickBackButton(); + + // Navigate to the 'Upgrading' page + $this->click( "link=Upgrading" ); + $this->waitForPageToLoad( PAGE_LOAD_TIME ); + $this->assertEquals( "Upgrading", $this->getText( LINK_DIV . "h2[1]" ) ); + } } diff --git a/tests/selenium/suites/AddNewPageTestCase.php b/tests/selenium/suites/AddNewPageTestCase.php index f3302e5edb..19dc927f2d 100644 --- a/tests/selenium/suites/AddNewPageTestCase.php +++ b/tests/selenium/suites/AddNewPageTestCase.php @@ -6,7 +6,7 @@ * @file * @ingroup Testing * Copyright (C) 2010 Nadeesha Weerasinghe - * http://www.calcey.com/ + * http://www.calcey.com/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,39 +27,37 @@ * */ - class AddNewPageTestCase extends SeleniumTestCase { - - // Verify adding a new page - public function testAddNewPage() { - $newPage = "new"; - $displayName = "New"; - $this->open( $this->getUrl() . - '/index.php?title=Main_Page&action=edit' ); - $this->type( "searchInput", $newPage ); - $this->click( "searchGoButton" ); - $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); - - // Verify 'Search results' text available - $source = $this->gettext( "firstHeading" ); - $correct = strstr( $source, "Search results" ); - $this->assertEquals( $correct, true); - - // Verify 'Create the page "" on this wiki' text available - $source = $this->gettext( "//div[@id='bodyContent']/div[4]/p/b" ); - $correct = strstr ( $source, "Create the page \"New\" on this wiki!" ); - $this->assertEquals( $correct, true ); - - $this->click( SeleniumTestConstants::LINK_START.$displayName ); - $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); - - $this->assertTrue($this->isElementPresent( SeleniumTestConstants::LINK_START."Create" )); - $this->type( "wpTextbox1", "add new test page" ); - $this->click( SeleniumTestConstants::BUTTON_SAVE ); - - // Verify new page added - $source = $this->gettext( "firstHeading" ); - $correct = strstr ( $source, $displayName ); - $this->assertEquals( $correct, true ); - } + // Verify adding a new page + public function testAddNewPage() { + $newPage = "new"; + $displayName = "New"; + $this->open( $this->getUrl() . + '/index.php?title=Main_Page&action=edit' ); + $this->type( "searchInput", $newPage ); + $this->click( "searchGoButton" ); + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); + + // Verify 'Search results' text available + $source = $this->gettext( "firstHeading" ); + $correct = strstr( $source, "Search results" ); + $this->assertEquals( $correct, true ); + + // Verify 'Create the page "" on this wiki' text available + $source = $this->gettext( "//div[@id='bodyContent']/div[4]/p/b" ); + $correct = strstr( $source, "Create the page \"New\" on this wiki!" ); + $this->assertEquals( $correct, true ); + + $this->click( SeleniumTestConstants::LINK_START . $displayName ); + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); + + $this->assertTrue( $this->isElementPresent( SeleniumTestConstants::LINK_START . "Create" ) ); + $this->type( "wpTextbox1", "add new test page" ); + $this->click( SeleniumTestConstants::BUTTON_SAVE ); + + // Verify new page added + $source = $this->gettext( "firstHeading" ); + $correct = strstr( $source, $displayName ); + $this->assertEquals( $correct, true ); + } } diff --git a/tests/selenium/suites/DeletePageAdminTestCase.php b/tests/selenium/suites/DeletePageAdminTestCase.php index 9898188fd5..eb25f8baa6 100644 --- a/tests/selenium/suites/DeletePageAdminTestCase.php +++ b/tests/selenium/suites/DeletePageAdminTestCase.php @@ -6,7 +6,7 @@ * @file * @ingroup Testing * Copyright (C) 2010 Nadeesha Weerasinghe - * http://www.calcey.com/ + * http://www.calcey.com/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,63 +27,60 @@ * */ - class DeletePageAdminTestCase extends SeleniumTestCase { + // Verify adding a new page + public function testDeletePage() { - // Verify adding a new page - public function testDeletePage() { - - - $newPage = "new"; - $displayName = "New"; + $newPage = "new"; + $displayName = "New"; - $this->open( $this->getUrl().'/index.php?title=Main_Page' ); + $this->open( $this->getUrl() . '/index.php?title=Main_Page' ); - $this->type( "searchInput", $newPage ); - $this->click( "searchGoButton" ); - $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); - $this->click( SeleniumTestConstants::LINK_START.$displayName ); - $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); - $this->type( SeleniumTestConstants::TEXT_EDITOR, $newPage." text" ); - $this->click( SeleniumTestConstants::BUTTON_SAVE ); + $this->type( "searchInput", $newPage ); + $this->click( "searchGoButton" ); + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); + $this->click( SeleniumTestConstants::LINK_START . $displayName ); + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); + $this->type( SeleniumTestConstants::TEXT_EDITOR, $newPage . " text" ); + $this->click( SeleniumTestConstants::BUTTON_SAVE ); - $this->open( $this->getUrl() . - '/index.php?title=Main_Page&action=edit' ); - $this->click( SeleniumTestConstants::LINK_START."Log out" ); - $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); - $this->click( SeleniumTestConstants::LINK_START."Log in / create account" ); - $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); + $this->open( $this->getUrl() . + '/index.php?title=Main_Page&action=edit' ); + $this->click( SeleniumTestConstants::LINK_START . "Log out" ); + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); + $this->click( SeleniumTestConstants::LINK_START . "Log in / create account" ); + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); - $this->type( "wpName1", $this->selenium->getUser() ); - $this->type( "wpPassword1", $this->selenium->getPass() ); - $this->click( "wpLoginAttempt" ); - $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); - $this->type( "searchInput", "new" ); - $this->click( "searchGoButton"); - $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); + $this->type( "wpName1", $this->selenium->getUser() ); + $this->type( "wpPassword1", $this->selenium->getPass() ); + $this->click( "wpLoginAttempt" ); + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); + $this->type( "searchInput", "new" ); + $this->click( "searchGoButton" ); + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); - // Verify 'Delete' link displayed - $source = $this->gettext( SeleniumTestConstants::LINK_START."Delete" ); - $correct = strstr ( $source, "Delete" ); - $this->assertEquals($correct, true ); + // Verify 'Delete' link displayed + $source = $this->gettext( SeleniumTestConstants::LINK_START . "Delete" ); + $correct = strstr( $source, "Delete" ); + $this->assertEquals( $correct, true ); - $this->click( SeleniumTestConstants::LINK_START."Delete" ); - $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); + $this->click( SeleniumTestConstants::LINK_START . "Delete" ); + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); - // Verify 'Delete' button available - $this->assertTrue($this->isElementPresent( "wpConfirmB" )); + // Verify 'Delete' button available + $this->assertTrue( $this->isElementPresent( "wpConfirmB" ) ); - $this->click( "wpConfirmB" ); - $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); + $this->click( "wpConfirmB" ); + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); - // Verify 'Action complete' text displayed - $source = $this->gettext( "firstHeading" ); - $correct = strstr ( $source, "Action complete" ); - $this->assertEquals( $correct, true ); + // Verify 'Action complete' text displayed + $source = $this->gettext( "firstHeading" ); + $correct = strstr( $source, "Action complete" ); + $this->assertEquals( $correct, true ); - // Verify ' has been deleted. See deletion log for a record of recent deletions.' text displayed - $source = $this->gettext( "//div[@id='bodyContent']/p[1]" ); - $correct = strstr ( $source, "\"New\" has been deleted. See deletion log for a record of recent deletions." ); - $this->assertEquals( $correct, true ); - } + // Verify ' has been deleted. See deletion log for a record of recent deletions.' text displayed + $source = $this->gettext( "//div[@id='bodyContent']/p[1]" ); + $correct = strstr( $source, "\"New\" has been deleted. See deletion log for a record of recent deletions." ); + $this->assertEquals( $correct, true ); + } } diff --git a/tests/selenium/suites/EmailPasswordTestCase.php b/tests/selenium/suites/EmailPasswordTestCase.php index 88d9cf97c6..81310b19cc 100644 --- a/tests/selenium/suites/EmailPasswordTestCase.php +++ b/tests/selenium/suites/EmailPasswordTestCase.php @@ -6,7 +6,7 @@ * @file * @ingroup Testing * Copyright (C) 2010 Nadeesha Weerasinghe - * http://www.calcey.com/ + * http://www.calcey.com/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,54 +28,51 @@ */ class EmailPasswordTestCase extends SeleniumTestCase { - - // change user name for each and every test (with in 24 hours) - private $userName = "test1"; - - public function testEmailPasswordButton() { - - $this->click( SeleniumTestConstants::LINK_START."Log out" ); - $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); - - $this->open( $this->getUrl().'/index.php?title=Main_Page' ); - - // click Log in / create account link to open Log in / create account' page - $this->click( SeleniumTestConstants::LINK_START."Log in / create account" ); - $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); - $this->assertTrue($this->isElementPresent( "wpMailmypassword" )); - } - - // Verify Email password functionality - public function testEmailPasswordMessages() { - - $this->click( SeleniumTestConstants::LINK_START."Log out" ); - $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); - - $this->open( $this->getUrl().'/index.php?title=Main_Page' ); - - // click Log in / create account link to open Log in / create account' page - $this->click( SeleniumTestConstants::LINK_START."Log in / create account" ); - $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); - - $this->type( "wpName1", "" ); - $this->click( "wpMailmypassword" ); - $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); - $this->assertEquals( "Login error\n You have not specified a valid user name.", - $this->getText("//div[@id='bodyContent']/div[4]")); - - $this->type( "wpName1", $this->userName ); - $this->click( "wpMailmypassword" ); - $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); - - // Can not run on localhost - $this->assertEquals( "A new password has been sent to the e-mail address registered for ".ucfirst($this->userName).". Please log in again after you receive it.", - $this->getText("//div[@id='bodyContent']/div[4]" )); - - $this->type( "wpName1", $this->userName ); - $this->click( "wpMailmypassword" ); - $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); - $this->assertEquals( "Login error\n A password reminder has already been sent, within the last 24 hours. To prevent abuse, only one password reminder will be sent per 24 hours.", - $this->getText( "//div[@id='bodyContent']/div[4]" )); - } + // change user name for each and every test (with in 24 hours) + private $userName = "test1"; + + public function testEmailPasswordButton() { + $this->click( SeleniumTestConstants::LINK_START . "Log out" ); + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); + + $this->open( $this->getUrl() . '/index.php?title=Main_Page' ); + + // click Log in / create account link to open Log in / create account' page + $this->click( SeleniumTestConstants::LINK_START . "Log in / create account" ); + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); + $this->assertTrue( $this->isElementPresent( "wpMailmypassword" ) ); + } + + // Verify Email password functionality + public function testEmailPasswordMessages() { + $this->click( SeleniumTestConstants::LINK_START . "Log out" ); + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); + + $this->open( $this->getUrl() . '/index.php?title=Main_Page' ); + + // click Log in / create account link to open Log in / create account' page + $this->click( SeleniumTestConstants::LINK_START . "Log in / create account" ); + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); + + $this->type( "wpName1", "" ); + $this->click( "wpMailmypassword" ); + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); + $this->assertEquals( "Login error\n You have not specified a valid user name.", + $this->getText( "//div[@id='bodyContent']/div[4]" ) ); + + $this->type( "wpName1", $this->userName ); + $this->click( "wpMailmypassword" ); + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); + + // Can not run on localhost + $this->assertEquals( "A new password has been sent to the e-mail address registered for " . ucfirst( $this->userName ) . ". Please log in again after you receive it.", + $this->getText( "//div[@id='bodyContent']/div[4]" ) ); + + $this->type( "wpName1", $this->userName ); + $this->click( "wpMailmypassword" ); + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); + $this->assertEquals( "Login error\n A password reminder has already been sent, within the last 24 hours. To prevent abuse, only one password reminder will be sent per 24 hours.", + $this->getText( "//div[@id='bodyContent']/div[4]" ) ); + } } diff --git a/tests/selenium/suites/MediaWikiEditorTestSuite.php b/tests/selenium/suites/MediaWikiEditorTestSuite.php index c0aee9f510..f9cfb7fb66 100644 --- a/tests/selenium/suites/MediaWikiEditorTestSuite.php +++ b/tests/selenium/suites/MediaWikiEditorTestSuite.php @@ -1,18 +1,19 @@ setLoginBeforeTests( true ); - parent::setUp(); - } - public function addTests() { - $testFiles = array( - 'tests/selenium/suites/AddNewPageTestCase.php', - 'tests/selenium/suites/AddContentToNewPageTestCase.php', - 'tests/selenium/suites/PreviewPageTestCase.php', - 'tests/selenium/suites/SavePageTestCase.php', - ); - parent::addTestFiles( $testFiles ); - } + public function setUp() { + $this->setLoginBeforeTests( true ); + parent::setUp(); + } + + public function addTests() { + $testFiles = array( + 'tests/selenium/suites/AddNewPageTestCase.php', + 'tests/selenium/suites/AddContentToNewPageTestCase.php', + 'tests/selenium/suites/PreviewPageTestCase.php', + 'tests/selenium/suites/SavePageTestCase.php', + ); + parent::addTestFiles( $testFiles ); + } } diff --git a/tests/selenium/suites/MyContributionsTestCase.php b/tests/selenium/suites/MyContributionsTestCase.php index b8d2d48d1d..730323dc33 100644 --- a/tests/selenium/suites/MyContributionsTestCase.php +++ b/tests/selenium/suites/MyContributionsTestCase.php @@ -6,7 +6,7 @@ * @file * @ingroup Testing * Copyright (C) 2010 Nadeesha Weerasinghe - * http://www.calcey.com/ + * http://www.calcey.com/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,36 +30,34 @@ require_once dirname( __DIR__ ) . '/SeleniumTestConstants.php'; class MyContributionsTestCase extends SeleniumTestCase { + // Verify user contributions + public function testRecentChangesAvailability() { + $newPage = $this->createNewTestPage( "MyContributionsTest" ); - // Verify user contributions - public function testRecentChangesAvailability() { + // Verify My contributions Link available + $this->assertTrue( $this->isElementPresent( "link=Contributions" ) ); - $newPage = $this->createNewTestPage( "MyContributionsTest" ); - - // Verify My contributions Link available - $this->assertTrue($this->isElementPresent( "link=Contributions" )); - - $this->click( "link=Contributions" ); - $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); + $this->click( "link=Contributions" ); + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); - // Verify recent page adding available on My Contributions list - $this->assertEquals( $newPage, $this->getText( "link=".$newPage )); + // Verify recent page adding available on My Contributions list + $this->assertEquals( $newPage, $this->getText( "link=" . $newPage ) ); - $this->type( SeleniumTestConstants::INPUT_SEARCH_BOX, $newPage ); - $this->click( SeleniumTestConstants::BUTTON_SEARCH ); - $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); - - $this->click( SeleniumTestConstants::LINK_EDIT ); - $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); - $this->type( SeleniumTestConstants::TEXT_EDITOR, $newPage . " text changed" ); - $this->click( SeleniumTestConstants::BUTTON_SAVE ); - $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); - $this->click( "link=Contributions" ); - $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); + $this->type( SeleniumTestConstants::INPUT_SEARCH_BOX, $newPage ); + $this->click( SeleniumTestConstants::BUTTON_SEARCH ); + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); - // Verify recent page changes available on My Contributions - $this->assertTrue( $this->isTextPresent( $newPage ) ); - } + $this->click( SeleniumTestConstants::LINK_EDIT ); + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); + $this->type( SeleniumTestConstants::TEXT_EDITOR, $newPage . " text changed" ); + $this->click( SeleniumTestConstants::BUTTON_SAVE ); + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); + $this->click( "link=Contributions" ); + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); + + // Verify recent page changes available on My Contributions + $this->assertTrue( $this->isTextPresent( $newPage ) ); + } } diff --git a/tests/selenium/suites/MyWatchListTestCase.php b/tests/selenium/suites/MyWatchListTestCase.php index 998fab9de7..bc7c768ce7 100644 --- a/tests/selenium/suites/MyWatchListTestCase.php +++ b/tests/selenium/suites/MyWatchListTestCase.php @@ -6,7 +6,7 @@ * @file * @ingroup Testing * Copyright (C) 2010 Nadeesha Weerasinghe - * http://www.calcey.com/ + * http://www.calcey.com/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,28 +30,26 @@ require_once dirname( __DIR__ ) . '/SeleniumTestConstants.php'; class MyWatchListTestCase extends SeleniumTestCase { - - // Verify user watchlist - public function testMyWatchlist() { - - $pageName = $this->createNewTestPage( "MyWatchListTest", true ); - // Verify link 'My Watchlist' available - $this->assertTrue( $this->isElementPresent( SeleniumTestConstants::LINK_START."Watchlist" ) ); - - $this->click( SeleniumTestConstants::LINK_START."Watchlist" ); - $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); - - // Verify newly added page to the watchlist is available - $this->assertEquals( $pageName, $this->getText( SeleniumTestConstants::LINK_START.$pageName )); - - $this->click( SeleniumTestConstants::LINK_START.$pageName ); - $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); - $this->click( SeleniumTestConstants::LINK_EDIT ); - $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); - $this->click( "wpWatchthis" ); - $this->click( SeleniumTestConstants::BUTTON_SAVE ); - $this->assertFalse( $this->isElementPresent( SeleniumTestConstants::LINK_START.$pageName ) ); - //todo watch using the dropdown menu - } + // Verify user watchlist + public function testMyWatchlist() { + $pageName = $this->createNewTestPage( "MyWatchListTest", true ); + // Verify link 'My Watchlist' available + $this->assertTrue( $this->isElementPresent( SeleniumTestConstants::LINK_START . "Watchlist" ) ); + + $this->click( SeleniumTestConstants::LINK_START . "Watchlist" ); + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); + + // Verify newly added page to the watchlist is available + $this->assertEquals( $pageName, $this->getText( SeleniumTestConstants::LINK_START . $pageName ) ); + + $this->click( SeleniumTestConstants::LINK_START . $pageName ); + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); + $this->click( SeleniumTestConstants::LINK_EDIT ); + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); + $this->click( "wpWatchthis" ); + $this->click( SeleniumTestConstants::BUTTON_SAVE ); + $this->assertFalse( $this->isElementPresent( SeleniumTestConstants::LINK_START . $pageName ) ); + //todo watch using the dropdown menu + } } diff --git a/tests/selenium/suites/PreviewPageTestCase.php b/tests/selenium/suites/PreviewPageTestCase.php index 32206b989d..615c23c87f 100644 --- a/tests/selenium/suites/PreviewPageTestCase.php +++ b/tests/selenium/suites/PreviewPageTestCase.php @@ -6,7 +6,7 @@ * @file * @ingroup Testing * Copyright (C) 2010 Nadeesha Weerasinghe - * http://www.calcey.com/ + * http://www.calcey.com/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,26 +28,25 @@ */ class PreviewPageTestCase extends SeleniumTestCase { + // Verify adding a new page + public function testPreviewPage() { + $wikiText = "Adding this page to test the \n Preview button functionality"; + $newPage = "Test Preview Page"; + $this->open( $this->getUrl() . + '/index.php?title=Main_Page&action=edit' ); + $this->getNewPage( $newPage ); + $this->type( SeleniumTestConstants::TEXT_EDITOR, $wikiText . "" ); + $this->assertTrue( $this->isElementPresent( "//*[@id='wpPreview']" ) ); - // Verify adding a new page - public function testPreviewPage() { - $wikiText = "Adding this page to test the \n Preview button functionality"; - $newPage = "Test Preview Page"; - $this->open( $this->getUrl() . - '/index.php?title=Main_Page&action=edit' ); - $this->getNewPage( $newPage ); - $this->type( SeleniumTestConstants::TEXT_EDITOR, $wikiText."" ); - $this->assertTrue($this->isElementPresent( "//*[@id='wpPreview']" )); + $this->click( "wpPreview" ); - $this->click( "wpPreview" ); + // Verify saved page available + $source = $this->gettext( "firstHeading" ); + $correct = strstr( $source, "Test Preview Page" ); + $this->assertEquals( $correct, true ); - // Verify saved page available - $source = $this->gettext( "firstHeading" ); - $correct = strstr( $source, "Test Preview Page" ); - $this->assertEquals( $correct, true); - - // Verify page content previewed succesfully - $contentOfPreviewPage = $this->getText( "//*[@id='content']" ); - $this->assertContains( $wikiText, $contentOfPreviewPage ); - } + // Verify page content previewed succesfully + $contentOfPreviewPage = $this->getText( "//*[@id='content']" ); + $this->assertContains( $wikiText, $contentOfPreviewPage ); + } } diff --git a/tests/selenium/suites/SavePageTestCase.php b/tests/selenium/suites/SavePageTestCase.php index 310ff20ac2..80eacc5a36 100644 --- a/tests/selenium/suites/SavePageTestCase.php +++ b/tests/selenium/suites/SavePageTestCase.php @@ -6,7 +6,7 @@ * @file * @ingroup Testing * Copyright (C) 2010 Nadeesha Weerasinghe - * http://www.calcey.com/ + * http://www.calcey.com/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,31 +28,30 @@ */ class SavePageTestCase extends SeleniumTestCase { - - // Verify adding a new page - public function testSavePage() { - $wikiText = "Adding this page to test the Save button functionality"; - $newPage = "Test Save Page"; - - $this->open( $this->getUrl() . - '/index.php?title=Main_Page&action=edit' ); - $this->getNewPage($newPage); - $this->type( SeleniumTestConstants::TEXT_EDITOR, $wikiText ); - - // verify 'Save' button available - $this->assertTrue($this->isElementPresent( SeleniumTestConstants::BUTTON_SAVE )); - $this->click( SeleniumTestConstants::BUTTON_SAVE ); - - // Verify saved page available - $source = $this->gettext( "firstHeading" ); - $correct = strstr( $source, "Test Save Page" ); - - // Verify Saved page name displayed correctly - $this->assertEquals( $correct, true ); - - // Verify page content saved succesfully - $contentOfSavedPage = $this->getText( "//*[@id='content']" ); - $this->assertContains( $wikiText, $contentOfSavedPage ); - $this->deletePage( $newPage ); - } + // Verify adding a new page + public function testSavePage() { + $wikiText = "Adding this page to test the Save button functionality"; + $newPage = "Test Save Page"; + + $this->open( $this->getUrl() . + '/index.php?title=Main_Page&action=edit' ); + $this->getNewPage( $newPage ); + $this->type( SeleniumTestConstants::TEXT_EDITOR, $wikiText ); + + // verify 'Save' button available + $this->assertTrue( $this->isElementPresent( SeleniumTestConstants::BUTTON_SAVE ) ); + $this->click( SeleniumTestConstants::BUTTON_SAVE ); + + // Verify saved page available + $source = $this->gettext( "firstHeading" ); + $correct = strstr( $source, "Test Save Page" ); + + // Verify Saved page name displayed correctly + $this->assertEquals( $correct, true ); + + // Verify page content saved succesfully + $contentOfSavedPage = $this->getText( "//*[@id='content']" ); + $this->assertContains( $wikiText, $contentOfSavedPage ); + $this->deletePage( $newPage ); + } } diff --git a/tests/selenium/suites/SimpleSeleniumConfig.php b/tests/selenium/suites/SimpleSeleniumConfig.php index 54def35ac4..a69351146e 100644 --- a/tests/selenium/suites/SimpleSeleniumConfig.php +++ b/tests/selenium/suites/SimpleSeleniumConfig.php @@ -1,30 +1,30 @@ 'mw_', - 'wgDBTableOptions' => 'ENGINE=InnoDB, DEFAULT CHARSET=binary', - 'wgDBmysql5' => 'false', - 'wgMainCacheType' => 'CACHE_NONE', + 'wgDBprefix' => 'mw_', + 'wgDBTableOptions' => 'ENGINE=InnoDB, DEFAULT CHARSET=binary', + 'wgDBmysql5' => 'false', + 'wgMainCacheType' => 'CACHE_NONE', 'wgParserCacheType' => 'CACHE_NONE', - 'wgMemCachedServers'=> array(), - 'wgLanguageCode' => 'en', - 'wgSitename' => 'test_wiki', - 'wgDefaultSkin' => 'chick' + 'wgMemCachedServers' => array(), + 'wgLanguageCode' => 'en', + 'wgSitename' => 'test_wiki', + 'wgDefaultSkin' => 'chick' ); $resources = array( 'db' => "$IP/tests/selenium/data/SimpleSeleniumTestDB.sql", 'images' => "$IP/tests/selenium/data/SimpleSeleniumTestImages.zip" ); - + $includeFiles = array_merge( $includeFiles, $includes ); - $globalConfigs = array_merge( $globalConfigs, $configs); + $globalConfigs = array_merge( $globalConfigs, $configs ); $resourceFiles = array_merge( $resourceFiles, $resources ); - return true; + return true; } -} \ No newline at end of file +}