Commit | Line | Data |
---|---|---|
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 | 27 | require_once 'CiviTest/CiviSeleniumTestCase.php'; |
e9479dcf EM |
28 | |
29 | /** | |
30 | * Class WebTest_ACL_AssignUsersToRolesTest | |
31 | */ | |
6a488035 TO |
32 | class WebTest_ACL_AssignUsersToRolesTest extends CiviSeleniumTestCase { |
33 | ||
34 | protected function setUp() { | |
35 | parent::setUp(); | |
36 | } | |
37 | ||
38 | function testAssignUsersToRoles() { | |
6a488035 TO |
39 | |
40 | $this->webtestLogin(); | |
42daf119 | 41 | |
bb21371e | 42 | $this->openCiviPage("group/add", "reset=1"); |
6a488035 TO |
43 | $groupTitle = "testGroup" . substr(sha1(rand()), 0, 4); |
44 | $this->type("title", $groupTitle); | |
45 | $this->click("group_type[1]"); | |
46 | $this->click("_qf_Edit_upload-bottom"); | |
47 | $this->waitForPageToLoad($this->getTimeoutMsec()); | |
48 | ||
6c5f7368 | 49 | $this->waitForText('crm-notification-container', "The Group '{$groupTitle}' has been saved."); |
6a488035 | 50 | |
118e964e | 51 | $this->openCiviPage("admin/options/acl_role", "action=add&reset=1", "_qf_Options_cancel-bottom"); |
6a488035 TO |
52 | |
53 | $label = "TestAclRole" . substr(sha1(rand()), 0, 4); | |
54 | $this->type("label", $label); | |
44c45561 | 55 | $this->click("_qf_Options_next-bottom"); |
6c5f7368 | 56 | |
44c45561 | 57 | $this->waitForText('crm-notification-container', "The ACL Role '{$label}' has been saved."); |
6a488035 | 58 | |
bb21371e | 59 | $this->openCiviPage("acl/entityrole", "action=add&reset=1"); |
6a488035 TO |
60 | |
61 | $this->select("acl_role_id", "label=" . $label); | |
62 | $this->select("entity_id", "label={$groupTitle}"); | |
63 | ||
6c5f7368 | 64 | $this->clickLink("_qf_EntityRole_next-botttom"); |
6a488035 | 65 | |
bb21371e | 66 | $this->openCiviPage("acl", "action=add&reset=1"); |
6a488035 TO |
67 | $this->click("group_id"); |
68 | $this->select("group_id", "label={$groupTitle}"); | |
69 | $this->select("operation", "label=View"); | |
70 | $this->select("entity_id", "label={$label}"); | |
71 | $this->type("name", "describe {$label}"); | |
6c5f7368 | 72 | $this->clickLink("_qf_ACL_next-bottom"); |
6a488035 TO |
73 | } |
74 | } | |
75 |