Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
4 | | CiviCRM version 4.3 | | |
5 | +--------------------------------------------------------------------+ | |
6 | | Copyright CiviCRM LLC (c) 2004-2013 | | |
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 | ||
6a488035 TO |
27 | require_once 'CiviTest/CiviSeleniumTestCase.php'; |
28 | class WebTest_Admin_Form_Setting_LocalizationTest extends CiviSeleniumTestCase { | |
29 | ||
30 | protected function setUp() { | |
31 | parent::setUp(); | |
32 | } | |
33 | ||
34 | function testDefaultCountryIsEnabled() { | |
6a488035 | 35 | $this->webtestLogin(); |
071a6d2e | 36 | $this->openCiviPage("admin/setting/localization", "reset=1"); |
6a488035 TO |
37 | $this->addSelection("countryLimit-t", "label=United States"); |
38 | $this->click("//select[@id='countryLimit-t']/option"); | |
39 | $this->click("//input[@name='remove' and @value='<< Remove' and @type='button' and @onclick=\"QFAMS.moveSelection('countryLimit', this.form.elements['countryLimit-f[]'], this.form.elements['countryLimit-t[]'], this.form.elements['countryLimit[]'], 'remove', 'none'); return false;\"]"); | |
40 | $this->addSelection("countryLimit-f", "label=Afghanistan"); | |
41 | $this->removeSelection("countryLimit-f", "label=Afghanistan"); | |
42 | $this->addSelection("countryLimit-f", "label=Cambodia"); | |
43 | $this->removeSelection("countryLimit-f", "label=Cambodia"); | |
44 | $this->addSelection("countryLimit-f", "label=Cameroon"); | |
45 | $this->removeSelection("countryLimit-f", "label=Cameroon"); | |
46 | $this->addSelection("countryLimit-f", "label=Canada"); | |
47 | $this->click("//input[@name='add' and @value='Add >>' and @type='button' and @onclick=\"QFAMS.moveSelection('countryLimit', this.form.elements['countryLimit-f[]'], this.form.elements['countryLimit-t[]'], this.form.elements['countryLimit[]'], 'add', 'none'); return false;\"]"); | |
48 | $this->click("_qf_Localization_next-bottom"); | |
49 | $this->waitForPageToLoad($this->getTimeoutMsec()); | |
50 | try { | |
51 | $this->assertFalse($this->isTextPresent("Your changes have been saved.")); | |
52 | } | |
53 | catch(PHPUnit_Framework_AssertionFailedError$e) { | |
54 | array_push($this->verificationErrors, $e->toString()); | |
55 | } | |
56 | } | |
57 | } | |
58 |