Webtest Fix- Master
[civicrm-core.git] / tests / phpunit / WebTest / Admin / Form / Setting / LocalizationTest.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
18 | |
19 | You should have received a copy of the GNU Affero General Public |
20 | License along with this program; if not, contact CiviCRM LLC |
21 | at info[AT]civicrm[DOT]org. If you have questions about the |
22 | GNU Affero General Public License or the licensing of CiviCRM, |
23 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
24 +--------------------------------------------------------------------+
25 */
26
27 require_once 'CiviTest/CiviSeleniumTestCase.php';
28
29 /**
30 * Class WebTest_Admin_Form_Setting_LocalizationTest
31 */
32 class WebTest_Admin_Form_Setting_LocalizationTest extends CiviSeleniumTestCase {
33
34 protected function setUp() {
35 parent::setUp();
36 }
37
38 public function testDefaultCountryIsEnabled() {
39 $this->webtestLogin();
40 $this->openCiviPage("admin/setting/localization", "reset=1");
41 $this->addSelection("countryLimit", "label=UNITED STATES");
42 $this->click("//select[@id='countryLimit']/option");
43 $this->click("//input[@name='remove']");
44 $this->addSelection("countryLimit", "label=AFGHANISTAN");
45 $this->removeSelection("countryLimit", "label=AFGHANISTAN");
46 $this->addSelection("countryLimit", "label=CAMBODIA");
47 $this->removeSelection("countryLimit", "label=CAMBODIA");
48 $this->addSelection("countryLimit", "label=CAMEROON");
49 $this->removeSelection("countryLimit", "label=CAMEROON");
50 $this->addSelection("countryLimit", "label=CANADA");
51 $this->click("//input[@name='add']");
52 $this->click("_qf_Localization_next-bottom");
53 $this->waitForPageToLoad($this->getTimeoutMsec());
54 try {
55 $this->assertFalse($this->isTextPresent("Your changes have been saved."));
56 }
57 catch (PHPUnit_Framework_AssertionFailedError$e) {
58 array_push($this->verificationErrors, $e->toString());
59 }
60 }
61
62 }