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