3 * MediaWikiDifferntDatabasePrefixTestCase
7 * Copyright (C) 2010 Nadeesha Weerasinghe <nadeesha@calcey.com>
8 * http://www.calcey.com/
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 * http://www.gnu.org/copyleft/gpl.html
26 require_once ( __DIR__
. '/MediaWikiInstallationCommonFunction.php' );
29 * Test Case ID : 02 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
30 * Test Case Name : Install MediaWiki with the same database and the different
31 * database prefixes(Share one database between multiple wikis).
32 * Version : MediaWiki 1.18alpha
34 class MediaWikiDifferntDatabasePrefixTestCase
extends MediaWikiInstallationCommonFunction
{
39 // Install Mediawiki using 'MySQL' database type.
40 public function testDifferentDatabasePrefix() {
41 $databaseName = DB_NAME_PREFIX
. "_db_prefix";
42 parent
::navigateInstallPage( $databaseName );
45 parent
::clickBackButton();
48 parent
::clickBackButton();
50 // To 'Database settings' page
51 parent
::clickBackButton();
53 // To 'Connect to database' page
54 parent
::clickBackButton();
56 // From 'Connect to database' page without database prefix
57 parent
::clickContinueButton();
59 // Verify upgrade existing message
60 $this->assertEquals( "Upgrade existing installation",
61 $this->getText( LINK_DIV
. "h2" ) );
63 // To 'Connect to database' page
64 parent
::clickBackButton();
66 // Input the database prefix
67 $this->type( "mysql_wgDBprefix", DATABASE_PREFIX
);
69 // From 'Connect to database' page with database prefix
70 parent
::clickContinueButton();
73 parent
::clickContinueButton();
74 parent
::completeNamePage();
75 parent
::clickContinueButton();
77 // Verify already installed warning message
78 $this->assertEquals( "Install",
79 $this->getText( LINK_DIV
. "h2" ) );
80 $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again. Please proceed to the next page.",
81 $this->getText( LINK_FORM
. "div[1]" ) );
83 parent
::clickContinueButton();
84 parent
::completePageSuccessfull();
85 $this->chooseCancelOnNextConfirmation();
86 parent
::restartInstallation();