Merge pull request #9410 from jmcclelland/CRM-19664
[civicrm-core.git] / tests / phpunit / WebTest / Admin / Form / Setting / LocalizationTest.php
CommitLineData
6a488035
TO
1<?php
2/*
3 +--------------------------------------------------------------------+
81621fee 4 | CiviCRM version 4.7 |
6a488035 5 +--------------------------------------------------------------------+
15a4309a 6 | Copyright CiviCRM LLC (c) 2004-2017 |
6a488035
TO
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 +--------------------------------------------------------------------+
d25dd0ee 25 */
6a488035 26
6a488035 27require_once 'CiviTest/CiviSeleniumTestCase.php';
e9479dcf
EM
28
29/**
30 * Class WebTest_Admin_Form_Setting_LocalizationTest
31 */
6a488035
TO
32class WebTest_Admin_Form_Setting_LocalizationTest extends CiviSeleniumTestCase {
33
34 protected function setUp() {
35 parent::setUp();
36 }
37
00be9182 38 public function testDefaultCountryIsEnabled() {
6a488035 39 $this->webtestLogin();
071a6d2e 40 $this->openCiviPage("admin/setting/localization", "reset=1");
fb93fc39
WA
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']");
6a488035
TO
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 }
92915c55 57 catch (PHPUnit_Framework_AssertionFailedError$e) {
6a488035
TO
58 array_push($this->verificationErrors, $e->toString());
59 }
60 }
96025800 61
6a488035 62}