MediaWiki  REL1_19
MediaWikiDifferntDatabasePrefixTestCase.php
Go to the documentation of this file.
00001 <?php
00002 
00030 require_once ( dirname( __FILE__ ) . '/MediaWikiInstallationCommonFunction.php' );
00031 
00039 class MediaWikiDifferntDatabasePrefixTestCase extends MediaWikiInstallationCommonFunction {
00040 
00041     function setUp() {
00042         parent::setUp();
00043     }
00044 
00045     // Install Mediawiki using 'MySQL' database type.
00046     public function testDifferentDatabasePrefix() {
00047 
00048         $databaseName = DB_NAME_PREFIX."_db_prefix";
00049         parent::navigateInstallPage( $databaseName );
00050 
00051         // To 'Options' page
00052         parent::clickBackButton();
00053 
00054         // To 'Name' page
00055         parent::clickBackButton();
00056 
00057         // To 'Database settings' page
00058         parent::clickBackButton();
00059 
00060         // To 'Connect to database' page
00061         parent::clickBackButton();
00062 
00063         // From 'Connect to database' page without database prefix
00064         parent::clickContinueButton();
00065 
00066         // Verify upgrade existing message
00067         $this->assertEquals( "Upgrade existing installation",
00068                 $this->getText( LINK_DIV."h2" ));
00069 
00070         // To 'Connect to database' page
00071         parent::clickBackButton();
00072 
00073         // Input the database prefix
00074         $this->type( "mysql_wgDBprefix", DATABASE_PREFIX );
00075 
00076         // From 'Connect to database' page with database prefix
00077         parent::clickContinueButton();
00078 
00079         // To 'Complete' page
00080         parent::clickContinueButton();
00081         parent::completeNamePage();
00082         parent::clickContinueButton();
00083 
00084         // Verify already installed warning message
00085         $this->assertEquals( "Install",
00086                 $this->getText( LINK_DIV."h2" ));
00087         $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again. Please proceed to the next page.",
00088                 $this->getText( LINK_FORM."div[1]" ));
00089 
00090         parent::clickContinueButton();
00091         parent::completePageSuccessfull();
00092         $this->chooseCancelOnNextConfirmation();
00093         parent::restartInstallation();
00094     }
00095 }