4 * MediaWikiHelpFieldHintTestCase
8 * Copyright (C) 2010 Nadeesha Weerasinghe <nadeesha@calcey.com>
9 * http://www.calcey.com/
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 * http://www.gnu.org/copyleft/gpl.html
26 * @addtogroup Maintenance
31 * Test Case ID : 29 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
32 * Test Case Name : Help field hint availability for the fields.
33 * Version : MediaWiki 1.18alpha
36 require_once ( __DIR__
. '/MediaWikiInstallationCommonFunction.php' );
38 class MediaWikiHelpFieldHintTestCase
extends MediaWikiInstallationCommonFunction
{
43 // Verify help field availability for the fields
44 public function testMySQLConnectToDatabaseFieldHint() {
46 parent
::navigateConnetToDatabasePage();
48 // Verify help field for 'Database host'
49 $this->click( "//div[@id='DB_wrapper_mysql']/div/div[1]/div/span[1]" );
50 $this->assertEquals( MYSQL_DATABASE_HOST_HELP
,
51 $this->getText( "//div[@id='DB_wrapper_mysql']/div/div[1]/div/span[2]" ) );
53 // Verify help field for 'Database name'
54 $this->click( "//div[@id='DB_wrapper_mysql']/fieldset[1]/div[1]/div[1]/div/span[1]" );
55 $this->assertEquals( MYSQL_DATABASE_NAME_HELP
,
56 $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[1]/div[1]/div[1]/div/span[2]" ) );
59 // Verify help field for 'Database table prefix'
60 $this->click( "//div[@id='DB_wrapper_mysql']/fieldset[1]/div[2]/div[1]/div/span[1]" );
61 $this->assertEquals( MYSQL_DATABASE_TABLE_PREFIX_HELP
,
62 $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[1]/div[1]/div[1]/div/span[2]/p[1]" ) );
64 // Verify help field for 'Database username'
65 $this->click( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[1]/div[1]/div/span[1]" );
66 $this->assertEquals( MYSQL_DATBASE_USERNAME_HELP
,
67 $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[1]/div[1]/div/span[2]" ) );
69 // Verify help field for 'Database password'
70 $this->click( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[2]/div[1]/div/span[1]" );
71 $this->assertEquals( MYSQL_DATABASE_PASSWORD_HELP
,
72 $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[2]/div[1]/div/span[2]/p" ) );
75 public function testSQLiteConnectToDatabaseFieldHint() {
76 parent
::navigateConnetToDatabasePage();
77 $this->click( "DBType_sqlite" );
79 // Verify help field for 'SQLite data directory'
80 $this->click( "//div[@id='DB_wrapper_sqlite']/div[1]/div[1]/div/span[1]" );
81 $this->assertEquals( SQLITE_DATA_DIRECTORY_HELP
,
82 $this->getText( "//div[@id='DB_wrapper_sqlite']/div[1]/div[1]/div/span[2]" ) );
84 // Verify help field for 'Database name'
85 $this->click( "//div[@id='DB_wrapper_sqlite']/div[2]/div[1]/div/span[1]" );
86 $this->assertEquals( SQLITE_DATABASE_NAME_HELP
, $this->getText( "//div[@id='DB_wrapper_sqlite']/div[2]/div[1]/div/span[2]/p" ) );
89 public function testDatabaseSettingsFieldHint() {
91 $databaseName = DB_NAME_PREFIX
. "_db_field";
92 parent
::navigateDatabaseSettingsPage( $databaseName );
94 // Verify help field for 'Search engine'
95 $this->click( LINK_FORM
. "div[2]/span[1]" );
96 $this->assertEquals( SEARCH_ENGINE_HELP
,
97 $this->getText( LINK_FORM
. "div[2]/span[2]" ) );
99 // Verify help field for 'Database character set'
100 $this->click( LINK_FORM
. "div[4]/span[1]" );
101 $this->assertEquals( DATABASE_CHARACTER_SET_HELP
,
102 $this->getText( LINK_FORM
. "div[4]/span[2]" ) );
103 parent
::restartInstallation();
106 public function testNameFieldHint() {
107 $databaseName = DB_NAME_PREFIX
. "_name_field";
108 parent
::navigateNamePage( $databaseName );
110 // Verify help field for 'Name of Wiki'
111 $this->click( LINK_FORM
. "div[1]/div[1]/div/span[1]" );
112 $this->assertEquals( NAME_OF_WIKI_HELP
,
113 $this->getText( LINK_FORM
. "div[1]/div[1]/div/span[2]/p" ) );
115 // Verify help field for 'Project namespace'
116 $this->click( LINK_FORM
. "div[2]/div[1]/div/span[1]" );
117 $this->assertEquals( PROJECT_NAMESPACE_HELP
,
118 $this->getText( LINK_FORM
. "div[2]/div[1]/div/span[2]/p" ) );
120 // Verify help field for 'Your Name'
121 $this->click( LINK_FORM
. "fieldset/div[1]/div[1]/div/span[1]" );
122 $this->assertEquals( USER_NAME_HELP
,
123 $this->getText( LINK_FORM
. "fieldset/div[1]/div[1]/div/span[2]/p" ) );
125 // Verify help field for 'E mail address'
126 $this->click( LINK_FORM
. "fieldset/div[4]/div[1]/div/span[1]" );
127 $this->assertEquals( EMAIL_ADDRESS_HELP
,
128 $this->getText( LINK_FORM
. "fieldset/div[4]/div[1]/div/span[2]/p" ) );
130 parent
::restartInstallation();