phpcs: More require/include is not a function
[lhc/web/wiklou.git] / tests / selenium / installer / MediaWikiDifferntDatabasePrefixTestCase.php
1 <?php
2 /**
3 * MediaWikiDifferntDatabasePrefixTestCase
4 *
5 * @file
6 * @ingroup Maintenance
7 * Copyright (C) 2010 Nadeesha Weerasinghe <nadeesha@calcey.com>
8 * http://www.calcey.com/
9 *
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.
14 *
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.
19 *
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
24 */
25
26 require_once __DIR__ . '/MediaWikiInstallationCommonFunction.php';
27
28 /**
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
33 */
34 class MediaWikiDifferntDatabasePrefixTestCase extends MediaWikiInstallationCommonFunction {
35 function setUp() {
36 parent::setUp();
37 }
38
39 // Install Mediawiki using 'MySQL' database type.
40 public function testDifferentDatabasePrefix() {
41 $databaseName = DB_NAME_PREFIX . "_db_prefix";
42 parent::navigateInstallPage( $databaseName );
43
44 // To 'Options' page
45 parent::clickBackButton();
46
47 // To 'Name' page
48 parent::clickBackButton();
49
50 // To 'Database settings' page
51 parent::clickBackButton();
52
53 // To 'Connect to database' page
54 parent::clickBackButton();
55
56 // From 'Connect to database' page without database prefix
57 parent::clickContinueButton();
58
59 // Verify upgrade existing message
60 $this->assertEquals( "Upgrade existing installation",
61 $this->getText( LINK_DIV . "h2" ) );
62
63 // To 'Connect to database' page
64 parent::clickBackButton();
65
66 // Input the database prefix
67 $this->type( "mysql_wgDBprefix", DATABASE_PREFIX );
68
69 // From 'Connect to database' page with database prefix
70 parent::clickContinueButton();
71
72 // To 'Complete' page
73 parent::clickContinueButton();
74 parent::completeNamePage();
75 parent::clickContinueButton();
76
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]" ) );
82
83 parent::clickContinueButton();
84 parent::completePageSuccessfull();
85 $this->chooseCancelOnNextConfirmation();
86 parent::restartInstallation();
87 }
88 }