1 | <?php |
||
15 | trait RegistrationsAdmin |
||
16 | { |
||
17 | |||
18 | /** |
||
19 | * This will select all checkboxes on a registration list table for the given array of |
||
20 | * registration ids. |
||
21 | * Assumes the actor is on a list table page for registrations. |
||
22 | * @param $registration_ids |
||
23 | */ |
||
24 | public function selectBulkActionCheckboxesForRegistrationIds(array $registration_ids) |
||
32 | |||
33 | |||
34 | /** |
||
35 | * Navigates the actor to the default registration list table page. |
||
36 | * @param string $additional_params |
||
37 | */ |
||
38 | public function amOnDefaultRegistrationsListTableAdminPage($additional_params = '') |
||
46 | |||
47 | |||
48 | /** |
||
49 | * Will enter the provided value in the registration list table search field and execute a search for that value. |
||
50 | * @param string $search_text |
||
51 | */ |
||
52 | public function searchForRegistrationOnRegistrationListTableWithText($search_text) |
||
59 | |||
60 | |||
61 | |||
62 | /** |
||
63 | * This will filter the registration list table to view registrations for the given event id. |
||
64 | * Assumption is made that you are logged into the admin but you do not need to be on the registration list table |
||
65 | * page. |
||
66 | * |
||
67 | * @param int $event_id The id of the event viewing registrations for. |
||
68 | */ |
||
69 | public function amViewingRegistrationsForEvent($event_id) |
||
75 | |||
76 | |||
77 | /** |
||
78 | * This helper will initiate registering for the given event via the backend. |
||
79 | * @param int $event_id The event to initiate registration for. |
||
80 | */ |
||
81 | public function amOnAdminRegistrationPageForEvent($event_id) |
||
87 | |||
88 | |||
89 | |||
90 | /** |
||
91 | * This clicks the View Details Link for Registration with the given Id |
||
92 | * @param $registration_id |
||
93 | */ |
||
94 | public function clickViewDetailsLinkForRegistrationWithId($registration_id) |
||
98 | |||
99 | |||
100 | /** |
||
101 | * /** |
||
102 | * This assumes you are on the admin details page for a registration in EE. It selects the given status in the |
||
103 | * dropdown for changing registration status. |
||
104 | * |
||
105 | * @param string $status_label_or_value Either the label for the dropdown option or the value for the option. |
||
106 | * @param $status_label_or_value |
||
107 | */ |
||
108 | public function selectRegistrationStatusOnRegistrationDetailsPageFor($status_label_or_value) |
||
115 | |||
116 | |||
117 | /** |
||
118 | * This selects (or deselects) the "Send Related Messages" checkbox on the Registration Details page. |
||
119 | * @param bool $send_related_messages |
||
120 | */ |
||
121 | public function selectSendRelatedMessagesOptionOnRegistrationDetailsPage($send_related_messages = true) |
||
133 | |||
134 | |||
135 | |||
136 | /** |
||
137 | * This assumes you are on the admin details page for a registration in EE. It selects the given status in the |
||
138 | * dropdown for changing registration status and submits the change. |
||
139 | * |
||
140 | * @param string $status_label_or_value Either the label for the dropdown option or the value for the option. |
||
141 | * @param bool $send_related_messages Whether or not to send related messages after changing the bulk action. |
||
142 | */ |
||
143 | public function changeRegistrationStatusOnRegistrationDetailsPageTo( |
||
152 | |||
153 | } |
Let’s assume that you have a directory layout like this:
and let’s assume the following content of
Bar.php
:If both files
OtherDir/Foo.php
andSomeDir/Foo.php
are loaded in the same runtime, you will see a PHP error such as the following:PHP Fatal error: Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.php
However, as
OtherDir/Foo.php
does not necessarily have to be loaded and the error is only triggered if it is loaded beforeOtherDir/Bar.php
, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias: