add a few remaining missing comment blocks (autogenerated)
[civicrm-core.git] / tests / phpunit / WebTest / Contact / AddViaProfileTest.php
CommitLineData
6a488035
TO
1<?php
2/*
3 +--------------------------------------------------------------------+
06a1bc01 4 | CiviCRM version 4.5 |
6a488035 5 +--------------------------------------------------------------------+
06a1bc01 6 | Copyright CiviCRM LLC (c) 2004-2014 |
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 +--------------------------------------------------------------------+
25*/
26
6a488035
TO
27require_once 'CiviTest/CiviSeleniumTestCase.php';
28class WebTest_Contact_AddViaProfileTest extends CiviSeleniumTestCase {
29
30 protected function setUp() {
31 parent::setUp();
32 }
33
34 function testAddViaCreateProfile() {
6a488035
TO
35 $this->webtestLogin();
36
79d6583c 37 $this->openCiviPage('profile/create', 'reset=1&gid=1', '_qf_Edit_cancel');
6a488035
TO
38
39 $firstName = 'Jo' . substr(sha1(rand()), 0, 4);
40 $lastName = 'Ad' . substr(sha1(rand()), 0, 7);
41
42 //contact details section
43 //fill in first name
44 $this->type("first_name", $firstName);
45
46 //fill in last name
47 $this->type("last_name", $lastName);
48
49 //address section
50 $this->type("street_address-1", "902C El Camino Way SW");
51 $this->type("city-1", "Dumfries");
52 $this->type("postal_code-1", "1234");
79d6583c 53 $this->assertElementContainsText('country-1', "United States");
6a488035
TO
54 $this->select("state_province-1", "value=1019");
55
56 // Clicking save.
57 $this->click("_qf_Edit_next");
58 $this->waitForPageToLoad($this->getTimeoutMsec());
59
79d6583c 60 $this->assertElementContainsText('css=.msg-text', "Your information has been saved.");
6a488035
TO
61 }
62}
63