Followup r78775, svn:eol-style native SET UP YOUR AUTOPROPS
[mediawiki.git] / tests / installer / MediaWikiErrorsNamepageTestCase.php
blob2537d9ee69c8820946c5c0f120ae5389bcb6da79
1 <?php
3 /**
4 * MediaWikiErrorsNamepageTestCase
6 * @file
7 * @ingroup Maintenance
8 * Copyright (C) 2010 Dan Nessett <dnessett@yahoo.com>
9 * http://citizendium.org/
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 : 10 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
32 * Test Case Name : Invalid/ blank values for fields in 'Name' page.
33 * Version : MediaWiki 1.18alpha
36 require_once 'MediaWikiInstallationCommonFunction.php';
38 class MediaWikiErrorsNamepageTestCase extends MediaWikiInstallationCommonFunction {
40 function setUp() {
41 parent::setUp();
44 // Verify warning message for the 'Name' page
45 public function testErrorsNamePage(){
47 $databaseName = DB_NAME_PREFIX."_error_name";
49 parent::navigateNamePage( $databaseName );
51 // Verify warning message for all blank fields
52 parent::clickContinueButton();
53 $this->assertEquals( "Enter a site name.",
54 $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
55 $this->assertEquals( "Enter an administrator username.",
56 $this->getText( "//div[@id='bodyContent']/div/div/div[3]/div[2]" ));
57 $this->assertEquals( "Enter a password for the administrator account.",
58 $this->getText( "//div[@id='bodyContent']/div/div/div[4]/div[2]" ));
60 // Verify warning message for the blank 'Site name'
61 $this->type( "config__AdminName", VALID_YOUR_NAME );
62 $this->type( "config__AdminPassword", VALID_PASSWORD );
63 $this->type( "config__AdminPassword2", VALID_PASSWORD_AGAIN );
64 parent::clickContinueButton();
65 $this->assertEquals( "Enter a site name.",
66 $this->getText(" //div[@id='bodyContent']/div/div/div[2]/div[2]" ));
68 // Input valid 'Site name'
69 $this->type( "config_wgSitename", VALID_WIKI_NAME );
72 // Verify warning message for the invalid "Project namespace'
73 $this->click( "config__NamespaceType_other" );
74 $this->type( "config_wgMetaNamespace", INVALID_NAMESPACE );
75 parent::clickContinueButton();
76 $this->assertEquals( "The specified namespace \"\" is invalid.Specify a different project namespace.",
77 $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
80 // Verify warning message for the blank 'Project namespace'
81 $this->type( "config_wgSitename", VALID_WIKI_NAME );
82 $this->click( "config__NamespaceType_other" );
83 $this->type( "config_wgMetaNamespace" , "" );
84 parent::clickContinueButton();
85 $this->assertEquals( "The specified namespace \"\" is invalid.Specify a different project namespace.",
86 $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
89 // Valid 'Project namespace'
90 $this->click( "config__NamespaceType_other" );
91 $this->type( "config_wgMetaNamespace", VALID_NAMESPACE );
92 parent::clickContinueButton();
95 // Valid 'Site name'
96 $this->click( "config__NamespaceType_site-name" );
97 $this->type( "config_wgSitename", VALID_WIKI_NAME );
100 // Verify warning message for blank 'Your name'
101 $this->type( "config__AdminName", " " );
102 parent::clickContinueButton();
103 $this->assertEquals( "Enter an administrator username.",
104 $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
107 // Verify warning message for blank 'Password'
108 $this->type( "config__AdminName", VALID_YOUR_NAME );
109 $this->type( "config__AdminPassword", " " );
110 parent::clickContinueButton();
111 $this->assertEquals( "Enter a password for the administrator account.",
112 $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
115 // Verify warning message for the blank 'Password again'
116 $this->type( "config_wgSitename", VALID_WIKI_NAME );
117 $this->type( "config__AdminPassword", VALID_PASSWORD );
118 $this->type( "config__AdminPassword2", " " );
119 parent::clickContinueButton();
120 $this->assertEquals( "The two passwords you entered do not match.",
121 $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
124 // Verify warning message for the different'Password' and 'Password again'
125 $this->type( "config_wgSitename", VALID_WIKI_NAME );
126 $this->type( "config__AdminPassword", VALID_PASSWORD );
127 $this->type( "config__AdminPassword2", INVALID_PASSWORD_AGAIN );
128 parent::clickContinueButton();
129 $this->assertEquals( "The two passwords you entered do not match.",
130 $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));