1 | <?php |
||
14 | trait EventsAdmin |
||
15 | { |
||
16 | |||
17 | /** |
||
18 | * @param string $additional_params |
||
19 | */ |
||
20 | public function amOnDefaultEventsListTablePage($additional_params = '') |
||
24 | |||
25 | |||
26 | /** |
||
27 | * Triggers the publishing of the Event. |
||
28 | */ |
||
29 | public function publishEvent() |
||
33 | |||
34 | |||
35 | /** |
||
36 | * Triggers saving the Event. |
||
37 | */ |
||
38 | public function saveEvent() |
||
42 | |||
43 | |||
44 | /** |
||
45 | * Navigates the actor to the event list table page and will attempt to edit the event for the given title. |
||
46 | * First this will search using the given title and then attempt to edit from the results of the search. |
||
47 | * |
||
48 | * Assumes actor is already logged in. |
||
49 | * @param $event_title |
||
50 | */ |
||
51 | public function amEditingTheEventWithTitle($event_title) |
||
59 | |||
60 | |||
61 | /** |
||
62 | * Navigates the user to the single event page (frontend view) for the given event title via clicking the "View" |
||
63 | * link for the event in the event list table. |
||
64 | * Assumes the actor is already logged in and on the Event list table page. |
||
65 | * |
||
66 | * @param string $event_title |
||
67 | */ |
||
68 | public function amOnEventPageAfterClickingViewLinkInListTableForEvent($event_title) |
||
73 | |||
74 | |||
75 | /** |
||
76 | * This performs the click action on the gear icon that triggers the advanced settings view state. |
||
77 | * Assumes the actor is already logged in and editing an event. |
||
78 | * |
||
79 | * @param int $row_number What ticket row to toggle open/close. |
||
80 | */ |
||
81 | public function toggleAdvancedSettingsViewForTicketRow($row_number = 1) |
||
85 | |||
86 | |||
87 | /** |
||
88 | * Toggles the TKT_is_taxable checkbox for the ticket in the given row. |
||
89 | * Assumes the actor is already logged in and editing an event and that the advanced settings view state for that |
||
90 | * ticket is "open". |
||
91 | * |
||
92 | * @param int $row_number What ticket row to toggle the checkbox for. |
||
93 | */ |
||
94 | public function toggleTicketIsTaxableForTicketRow($row_number = 1) |
||
98 | |||
99 | |||
100 | /** |
||
101 | * Use to change the default registration status for the event. |
||
102 | * Assumes the view is already on the event editor. |
||
103 | * @param $registration_status |
||
104 | */ |
||
105 | public function changeDefaultRegistrationStatusTo($registration_status) |
||
112 | |||
113 | |||
114 | /** |
||
115 | * Use this from the context of the event editor to select the given custom template for a given message type and |
||
116 | * messenger. |
||
117 | * |
||
118 | * @param string $message_type_label The visible label for the message type (eg Registration Approved) |
||
119 | * @param string $messenger_slug The slug for the messenger (eg 'email') |
||
120 | * @param string $custom_template_label The visible label in the select input for the custom template you want |
||
121 | * selected. |
||
122 | */ |
||
123 | public function selectCustomTemplateFor($message_type_label, $messenger_slug, $custom_template_label) |
||
131 | } |
This check looks for methods that are used by a trait but not required by it.
To illustrate, let’s look at the following code example
The trait
Idable
provides a methodequalsId
that in turn relies on the methodgetId()
. If this method does not exist on a class mixing in this trait, the method will fail.Adding the
getId()
as an abstract method to the trait will make sure it is available.