MediaWiki  REL1_19
MediaWikiUpgradeExistingDatabaseTestCase.php
Go to the documentation of this file.
00001 <?php
00002 
00031 require_once (dirname(__FILE__).'/'.'MediaWikiInstallationCommonFunction.php');
00032 
00040 class MediaWikiUpgradeExistingDatabaseTestCase extends MediaWikiInstallationCommonFunction {
00041     
00042     function setUp() {
00043         parent::setUp();
00044     }
00045     
00046     // Install Mediawiki using 'MySQL' database type.
00047     public function testUpgradeExistingDatabase() {
00048         
00049         $databaseName = DB_NAME_PREFIX."_upgrade_existing";
00050         parent::navigateInstallPage( $databaseName );
00051         
00052         $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" );
00053         $this->assertEquals( "Install", $this->getText( LINK_DIV."h2" ));
00054         $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again. Please proceed to the next page.",
00055                 $this->getText( LINK_DIV."div[2]/form/div[1]/div[2]" ));
00056         
00057         // 'Optionis' page
00058         parent::clickBackButton();
00059         
00060         // 'Name' page
00061         parent::clickBackButton();
00062         
00063         // 'Database settings' page
00064         parent::clickBackButton();
00065         
00066         // 'Connect to database' page
00067         parent::clickBackButton();
00068         $this->type( "mysql_wgDBname", $databaseName );
00069         parent::clickContinueButton();
00070         
00071         // 'Upgrade existing installation' page  displayed next to the 'Connect to database' page.
00072         $this->assertEquals( "Upgrade existing installation", $this->getText( LINK_DIV."h2" ));
00073         
00074         // Warning message displayed.
00075         $this->assertEquals( "There are MediaWiki tables in this database. To upgrade them to MediaWiki 1.18alpha, click Continue.",
00076                 $this->getText( LINK_DIV."div[2]/form/div[1]/div[2]" ));
00077         
00078         parent::clickContinueButton();
00079         $this->assertEquals( "Upgrade existing installation",
00080                 $this->getText( LINK_DIV."h2" ));
00081         
00082         // 'Upgrade complete.' text display
00083         $this->assertEquals("Upgrade complete.",
00084                 $this->getText("//div[@id='bodyContent']/div/div[1]/div[4]/form/div[1]/div[2]/p[1]"));
00085         
00086         $this->assertEquals("You can now Folder/index.php start using your wiki.",
00087                 $this->getText("//div[@id='bodyContent']/div/div[1]/div[4]/form/div[1]/div[2]/p[2]" ));
00088         
00089         $this->assertEquals( "Folder/index.php start using your wiki",
00090                 $this->getText( "link=Folder/index.php start using your wiki" ));
00091         
00092         $this->assertTrue($this->isElementPresent( "submit-regenerate" ));
00093         $this->click( "submit-regenerate" );
00094         $this->waitForPageToLoad( PAGE_LOAD_TIME );
00095         $this->assertEquals( "Database settings",
00096                 $this->getText( LINK_DIV."h2" ));
00097         
00098         // 'Database settings' page
00099         parent::clickContinueButton();
00100         
00101         // Name page
00102         parent::completeNamePage();
00103         
00104         // Options page
00105         parent::clickContinueButton();
00106         
00107         // Install page
00108         $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again. Please proceed to the next page.",
00109                 $this->getText( LINK_FORM."div[1]/div[2]" ));
00110         parent::clickContinueButton();
00111         
00112         // complete
00113         parent::completePageSuccessfull();
00114         $this->chooseCancelOnNextConfirmation();
00115         parent::restartInstallation();
00116     }
00117 }