3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.3 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2013 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
28 require_once 'CiviTest/CiviSeleniumTestCase.php';
29 class WebTest_Profile_DedupeTest
extends CiviSeleniumTestCase
{
31 protected function setUp() {
35 function testProfileCreateDupeStrictDefault() {
36 // This is the path where our testing install resides.
37 // The rest of URL is defined in CiviSeleniumTestCase base class, in
39 $this->open($this->sboxPath
);
41 // lets give profile related permision to anonymous user.
42 $permission = array('edit-1-profile-create', 'edit-1-profile-edit', 'edit-1-profile-listings', 'edit-1-profile-view');
43 $this->changePermissions($permission);
45 // Go directly to the URL of the screen that you will beadding New Individual.
46 $this->openCiviPage('contact/add', 'reset=1&ct=Individual');
48 $firstName = "John" . substr(sha1(rand()), 0, 7);
49 $lastName = "Smith" . substr(sha1(rand()), 0, 7);
50 $email = $firstName . "@" . $lastName . ".com";
52 $this->type("first_name", $firstName);
55 $this->type("last_name", $lastName);
58 $this->type("email_1_email", $email);
61 $this->click("_qf_Contact_upload_view");
62 $this->waitForPageToLoad($this->getTimeoutMsec());
63 $individualName = $this->getText("xpath=//div[@class='crm-summary-display_name']");
64 $this->assertElementContainsText('crm-notification-container', "$individualName has been created.");
66 // submit dupe using profile/create as anonymous
67 $this->openCiviPage('profile/create', 'gid=4&reset=1', '_qf_Edit_next');
69 $firstName = "John" . substr(sha1(rand()), 0, 7);
70 $lastName = "Smith" . substr(sha1(rand()), 0, 7);
73 $this->type("first_name", $firstName);
76 $this->type("last_name", $lastName);
79 $this->type("email-Primary", $email);
82 $this->click("_qf_Edit_next");
83 $this->waitForTextPresent("A record already exists with the same information.");