@@ -87,7 +87,7 @@ |
||
87 | 87 | { |
88 | 88 | $this->evaluation_callback = $evaluation_callback instanceof Closure |
89 | 89 | ? $evaluation_callback |
90 | - : function (ContextInterface $context, $acceptable_values) { |
|
90 | + : function(ContextInterface $context, $acceptable_values) { |
|
91 | 91 | return in_array($context->slug(), $acceptable_values, true); |
92 | 92 | }; |
93 | 93 | } |
@@ -17,145 +17,145 @@ |
||
17 | 17 | class ContextChecker |
18 | 18 | { |
19 | 19 | |
20 | - /** |
|
21 | - * A unique string used to identify where this ContextChecker is being employed |
|
22 | - * Is currently only used within the hook name for the filterable return value of isAllowed(). |
|
23 | - * |
|
24 | - * @var string $identifier |
|
25 | - */ |
|
26 | - private $identifier; |
|
27 | - |
|
28 | - /** |
|
29 | - * A list of values to be compared against the slug of the Context class passed to isAllowed() |
|
30 | - * |
|
31 | - * @var array $acceptable_values |
|
32 | - */ |
|
33 | - private $acceptable_values; |
|
34 | - |
|
35 | - /** |
|
36 | - * Closure that will be called to perform the evaluation within isAllowed(). |
|
37 | - * If none is provided, then a simple type sensitive in_array() check will be used |
|
38 | - * and return true if the incoming Context::slug() is found within the array of $acceptable_values. |
|
39 | - * |
|
40 | - * @var Closure $evaluation_callback |
|
41 | - */ |
|
42 | - private $evaluation_callback; |
|
43 | - |
|
44 | - |
|
45 | - /** |
|
46 | - * ContextChecker constructor. |
|
47 | - * |
|
48 | - * @param string $identifier |
|
49 | - * @param array $acceptable_values |
|
50 | - * @param Closure|null $evaluation_callback [optional] |
|
51 | - */ |
|
52 | - public function __construct($identifier, array $acceptable_values, Closure $evaluation_callback = null) |
|
53 | - { |
|
54 | - $this->setIdentifier($identifier); |
|
55 | - $this->setAcceptableValues($acceptable_values); |
|
56 | - $this->setEvaluationCallback($evaluation_callback); |
|
57 | - } |
|
58 | - |
|
59 | - |
|
60 | - /** |
|
61 | - * @param string $identifier |
|
62 | - */ |
|
63 | - private function setIdentifier($identifier) |
|
64 | - { |
|
65 | - $this->identifier = sanitize_key($identifier); |
|
66 | - } |
|
67 | - |
|
68 | - |
|
69 | - /** |
|
70 | - * @param array $acceptable_values |
|
71 | - */ |
|
72 | - private function setAcceptableValues(array $acceptable_values) |
|
73 | - { |
|
74 | - $this->acceptable_values = $acceptable_values; |
|
75 | - } |
|
76 | - |
|
77 | - |
|
78 | - /** |
|
79 | - * @param Closure $evaluation_callback |
|
80 | - */ |
|
81 | - private function setEvaluationCallback(Closure $evaluation_callback = null) |
|
82 | - { |
|
83 | - $this->evaluation_callback = $evaluation_callback instanceof Closure |
|
84 | - ? $evaluation_callback |
|
85 | - : function (ContextInterface $context, $acceptable_values) { |
|
86 | - return in_array($context->slug(), $acceptable_values, true); |
|
87 | - }; |
|
88 | - } |
|
89 | - |
|
90 | - |
|
91 | - /** |
|
92 | - * @return string |
|
93 | - */ |
|
94 | - protected function identifier() |
|
95 | - { |
|
96 | - return $this->identifier; |
|
97 | - } |
|
98 | - |
|
99 | - |
|
100 | - /** |
|
101 | - * @return array |
|
102 | - */ |
|
103 | - protected function acceptableValues() |
|
104 | - { |
|
105 | - return apply_filters( |
|
106 | - "FHEE__EventEspresso_core_domain_entities_context_ContextChecker__{$this->identifier}__acceptableValues", |
|
107 | - $this->acceptable_values |
|
108 | - ); |
|
109 | - } |
|
110 | - |
|
111 | - |
|
112 | - /** |
|
113 | - * @return Closure |
|
114 | - */ |
|
115 | - protected function evaluationCallback() |
|
116 | - { |
|
117 | - return $this->evaluation_callback; |
|
118 | - } |
|
119 | - |
|
120 | - |
|
121 | - /** |
|
122 | - * Returns true if the incoming Context class slug matches one of the preset acceptable values. |
|
123 | - * The result is filterable using the identifier for this ContextChecker. |
|
124 | - * example: |
|
125 | - * If this ContextChecker's $identifier was set to "registration-checkout-type", |
|
126 | - * then the filter here would be named: |
|
127 | - * "FHEE__EventEspresso_core_domain_entities_context_ContextChecker__registration-checkout-type__isAllowed". |
|
128 | - * Other code could hook into the filter in isAllowed() using the above name |
|
129 | - * and test for additional acceptable values. |
|
130 | - * So if the set of $acceptable_values was: [ "initial-visit", "revisit" ] |
|
131 | - * then adding a filter to |
|
132 | - * "FHEE__EventEspresso_core_domain_entities_context_ContextChecker__registration-checkout-type__isAllowed", |
|
133 | - * would allow you to perform your own conditional and allow "wait-list-checkout" as an acceptable value. |
|
134 | - * example: |
|
135 | - * add_filter( |
|
136 | - * 'FHEE__EventEspresso_core_domain_entities_context_ContextChecker__registration-checkout-type__isAllowed', |
|
137 | - * function ($is_allowed, ContextInterface $context) { return $context->slug() === 'wait-list-checkout' |
|
138 | - * ? true |
|
139 | - * : $is_allowed; |
|
140 | - * }, |
|
141 | - * 10, |
|
142 | - * 2 |
|
143 | - * ); |
|
144 | - * |
|
145 | - * @param ContextInterface $context |
|
146 | - * @return boolean |
|
147 | - */ |
|
148 | - public function isAllowed(ContextInterface $context) |
|
149 | - { |
|
150 | - $evaluation_callback = $this->evaluationCallback(); |
|
151 | - return filter_var( |
|
152 | - apply_filters( |
|
153 | - "FHEE__EventEspresso_core_domain_entities_context_ContextChecker__{$this->identifier}__isAllowed", |
|
154 | - $evaluation_callback($context, $this->acceptableValues()), |
|
155 | - $context, |
|
156 | - $this |
|
157 | - ), |
|
158 | - FILTER_VALIDATE_BOOLEAN |
|
159 | - ); |
|
160 | - } |
|
20 | + /** |
|
21 | + * A unique string used to identify where this ContextChecker is being employed |
|
22 | + * Is currently only used within the hook name for the filterable return value of isAllowed(). |
|
23 | + * |
|
24 | + * @var string $identifier |
|
25 | + */ |
|
26 | + private $identifier; |
|
27 | + |
|
28 | + /** |
|
29 | + * A list of values to be compared against the slug of the Context class passed to isAllowed() |
|
30 | + * |
|
31 | + * @var array $acceptable_values |
|
32 | + */ |
|
33 | + private $acceptable_values; |
|
34 | + |
|
35 | + /** |
|
36 | + * Closure that will be called to perform the evaluation within isAllowed(). |
|
37 | + * If none is provided, then a simple type sensitive in_array() check will be used |
|
38 | + * and return true if the incoming Context::slug() is found within the array of $acceptable_values. |
|
39 | + * |
|
40 | + * @var Closure $evaluation_callback |
|
41 | + */ |
|
42 | + private $evaluation_callback; |
|
43 | + |
|
44 | + |
|
45 | + /** |
|
46 | + * ContextChecker constructor. |
|
47 | + * |
|
48 | + * @param string $identifier |
|
49 | + * @param array $acceptable_values |
|
50 | + * @param Closure|null $evaluation_callback [optional] |
|
51 | + */ |
|
52 | + public function __construct($identifier, array $acceptable_values, Closure $evaluation_callback = null) |
|
53 | + { |
|
54 | + $this->setIdentifier($identifier); |
|
55 | + $this->setAcceptableValues($acceptable_values); |
|
56 | + $this->setEvaluationCallback($evaluation_callback); |
|
57 | + } |
|
58 | + |
|
59 | + |
|
60 | + /** |
|
61 | + * @param string $identifier |
|
62 | + */ |
|
63 | + private function setIdentifier($identifier) |
|
64 | + { |
|
65 | + $this->identifier = sanitize_key($identifier); |
|
66 | + } |
|
67 | + |
|
68 | + |
|
69 | + /** |
|
70 | + * @param array $acceptable_values |
|
71 | + */ |
|
72 | + private function setAcceptableValues(array $acceptable_values) |
|
73 | + { |
|
74 | + $this->acceptable_values = $acceptable_values; |
|
75 | + } |
|
76 | + |
|
77 | + |
|
78 | + /** |
|
79 | + * @param Closure $evaluation_callback |
|
80 | + */ |
|
81 | + private function setEvaluationCallback(Closure $evaluation_callback = null) |
|
82 | + { |
|
83 | + $this->evaluation_callback = $evaluation_callback instanceof Closure |
|
84 | + ? $evaluation_callback |
|
85 | + : function (ContextInterface $context, $acceptable_values) { |
|
86 | + return in_array($context->slug(), $acceptable_values, true); |
|
87 | + }; |
|
88 | + } |
|
89 | + |
|
90 | + |
|
91 | + /** |
|
92 | + * @return string |
|
93 | + */ |
|
94 | + protected function identifier() |
|
95 | + { |
|
96 | + return $this->identifier; |
|
97 | + } |
|
98 | + |
|
99 | + |
|
100 | + /** |
|
101 | + * @return array |
|
102 | + */ |
|
103 | + protected function acceptableValues() |
|
104 | + { |
|
105 | + return apply_filters( |
|
106 | + "FHEE__EventEspresso_core_domain_entities_context_ContextChecker__{$this->identifier}__acceptableValues", |
|
107 | + $this->acceptable_values |
|
108 | + ); |
|
109 | + } |
|
110 | + |
|
111 | + |
|
112 | + /** |
|
113 | + * @return Closure |
|
114 | + */ |
|
115 | + protected function evaluationCallback() |
|
116 | + { |
|
117 | + return $this->evaluation_callback; |
|
118 | + } |
|
119 | + |
|
120 | + |
|
121 | + /** |
|
122 | + * Returns true if the incoming Context class slug matches one of the preset acceptable values. |
|
123 | + * The result is filterable using the identifier for this ContextChecker. |
|
124 | + * example: |
|
125 | + * If this ContextChecker's $identifier was set to "registration-checkout-type", |
|
126 | + * then the filter here would be named: |
|
127 | + * "FHEE__EventEspresso_core_domain_entities_context_ContextChecker__registration-checkout-type__isAllowed". |
|
128 | + * Other code could hook into the filter in isAllowed() using the above name |
|
129 | + * and test for additional acceptable values. |
|
130 | + * So if the set of $acceptable_values was: [ "initial-visit", "revisit" ] |
|
131 | + * then adding a filter to |
|
132 | + * "FHEE__EventEspresso_core_domain_entities_context_ContextChecker__registration-checkout-type__isAllowed", |
|
133 | + * would allow you to perform your own conditional and allow "wait-list-checkout" as an acceptable value. |
|
134 | + * example: |
|
135 | + * add_filter( |
|
136 | + * 'FHEE__EventEspresso_core_domain_entities_context_ContextChecker__registration-checkout-type__isAllowed', |
|
137 | + * function ($is_allowed, ContextInterface $context) { return $context->slug() === 'wait-list-checkout' |
|
138 | + * ? true |
|
139 | + * : $is_allowed; |
|
140 | + * }, |
|
141 | + * 10, |
|
142 | + * 2 |
|
143 | + * ); |
|
144 | + * |
|
145 | + * @param ContextInterface $context |
|
146 | + * @return boolean |
|
147 | + */ |
|
148 | + public function isAllowed(ContextInterface $context) |
|
149 | + { |
|
150 | + $evaluation_callback = $this->evaluationCallback(); |
|
151 | + return filter_var( |
|
152 | + apply_filters( |
|
153 | + "FHEE__EventEspresso_core_domain_entities_context_ContextChecker__{$this->identifier}__isAllowed", |
|
154 | + $evaluation_callback($context, $this->acceptableValues()), |
|
155 | + $context, |
|
156 | + $this |
|
157 | + ), |
|
158 | + FILTER_VALIDATE_BOOLEAN |
|
159 | + ); |
|
160 | + } |
|
161 | 161 | } |
@@ -18,14 +18,14 @@ |
||
18 | 18 | interface ContextInterface |
19 | 19 | { |
20 | 20 | |
21 | - /** |
|
22 | - * @return string |
|
23 | - */ |
|
24 | - public function slug(); |
|
21 | + /** |
|
22 | + * @return string |
|
23 | + */ |
|
24 | + public function slug(); |
|
25 | 25 | |
26 | 26 | |
27 | - /** |
|
28 | - * @return string |
|
29 | - */ |
|
30 | - public function description(); |
|
27 | + /** |
|
28 | + * @return string |
|
29 | + */ |
|
30 | + public function description(); |
|
31 | 31 | } |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | * Gets an array for converting between QST_system and QST_IDs for system questions. Eg, if you want to know |
365 | 365 | * which system question QST_ID corresponds to the QST_system 'city', use EEM_Question::instance()->get_Question_ID_from_system_string('city'); |
366 | 366 | * @param $QST_system |
367 | - * @return int of QST_ID for the question that corresponds to that QST_system |
|
367 | + * @return string of QST_ID for the question that corresponds to that QST_system |
|
368 | 368 | */ |
369 | 369 | public function get_Question_ID_from_system_string($QST_system) |
370 | 370 | { |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | |
426 | 426 | |
427 | 427 | /** |
428 | - * @return array |
|
428 | + * @return EEM_Question |
|
429 | 429 | */ |
430 | 430 | public function question_descriptions() |
431 | 431 | { |
@@ -14,8 +14,8 @@ discard block |
||
14 | 14 | |
15 | 15 | //need the MER plugin active for this test (we'll deactivate it after). |
16 | 16 | $I->ensurePluginActive( |
17 | - 'event-espresso-mer-multi-event-registration', |
|
18 | - 'activated' |
|
17 | + 'event-espresso-mer-multi-event-registration', |
|
18 | + 'activated' |
|
19 | 19 | ); |
20 | 20 | |
21 | 21 | //k now we need to make sure the registration multi-status message type is active because it isn't by default |
@@ -73,38 +73,38 @@ discard block |
||
73 | 73 | $I->loginAsAdmin(); |
74 | 74 | $I->amOnMessagesActivityListTablePage(); |
75 | 75 | $I->see( |
76 | - '[email protected]', |
|
77 | - MessagesAdmin::messagesActivityListTableCellSelectorFor( |
|
78 | - 'to', |
|
79 | - 'Registration Multi-status Summary', |
|
80 | - MessagesAdmin::MESSAGE_STATUS_SENT, |
|
81 | - '', |
|
82 | - 'Primary Registrant' |
|
83 | - ) |
|
76 | + '[email protected]', |
|
77 | + MessagesAdmin::messagesActivityListTableCellSelectorFor( |
|
78 | + 'to', |
|
79 | + 'Registration Multi-status Summary', |
|
80 | + MessagesAdmin::MESSAGE_STATUS_SENT, |
|
81 | + '', |
|
82 | + 'Primary Registrant' |
|
83 | + ) |
|
84 | 84 | ); |
85 | 85 | $I->see( |
86 | - '[email protected]', |
|
87 | - MessagesAdmin::messagesActivityListTableCellSelectorFor( |
|
88 | - 'to', |
|
89 | - 'Registration Multi-status Summary', |
|
90 | - MessagesAdmin::MESSAGE_STATUS_SENT |
|
91 | - ) |
|
86 | + '[email protected]', |
|
87 | + MessagesAdmin::messagesActivityListTableCellSelectorFor( |
|
88 | + 'to', |
|
89 | + 'Registration Multi-status Summary', |
|
90 | + MessagesAdmin::MESSAGE_STATUS_SENT |
|
91 | + ) |
|
92 | 92 | ); |
93 | 93 | //verify count |
94 | 94 | $I->verifyMatchingCountofTextInMessageActivityListTableFor( |
95 | - 1, |
|
96 | - '[email protected]', |
|
97 | - 'to', |
|
98 | - 'Registration Multi-status Summary', |
|
99 | - MessagesAdmin::MESSAGE_STATUS_SENT, |
|
100 | - 'Email', |
|
101 | - 'Primary Registrant' |
|
95 | + 1, |
|
96 | + '[email protected]', |
|
97 | + 'to', |
|
98 | + 'Registration Multi-status Summary', |
|
99 | + MessagesAdmin::MESSAGE_STATUS_SENT, |
|
100 | + 'Email', |
|
101 | + 'Primary Registrant' |
|
102 | 102 | ); |
103 | 103 | $I->verifyMatchingCountofTextInMessageActivityListTableFor( |
104 | - 1, |
|
105 | - '[email protected]', |
|
106 | - 'to', |
|
107 | - 'Registration Multi-status Summary' |
|
104 | + 1, |
|
105 | + '[email protected]', |
|
106 | + 'to', |
|
107 | + 'Registration Multi-status Summary' |
|
108 | 108 | ); |
109 | 109 | |
110 | 110 | //okay now let's do some registrations for just the first event and verify that registration multi-status summary is NOT |
@@ -134,25 +134,25 @@ discard block |
||
134 | 134 | $I->loginAsAdmin(); |
135 | 135 | $I->amOnMessagesActivityListTablePage(); |
136 | 136 | $I->dontSee( |
137 | - '[email protected]', |
|
138 | - MessagesAdmin::messagesActivityListTableCellSelectorFor( |
|
139 | - 'to', |
|
140 | - 'Registration Multi-status Summary', |
|
141 | - MessagesAdmin::MESSAGE_STATUS_SENT, |
|
142 | - '', |
|
143 | - 'Primary Registrant' |
|
144 | - ) |
|
137 | + '[email protected]', |
|
138 | + MessagesAdmin::messagesActivityListTableCellSelectorFor( |
|
139 | + 'to', |
|
140 | + 'Registration Multi-status Summary', |
|
141 | + MessagesAdmin::MESSAGE_STATUS_SENT, |
|
142 | + '', |
|
143 | + 'Primary Registrant' |
|
144 | + ) |
|
145 | 145 | ); |
146 | 146 | //there should still only be one admin multi-status summary thing. |
147 | 147 | $I->verifyMatchingCountofTextInMessageActivityListTableFor( |
148 | - 1, |
|
149 | - '[email protected]', |
|
150 | - 'to', |
|
151 | - 'Registration Multi-status Summary' |
|
148 | + 1, |
|
149 | + '[email protected]', |
|
150 | + 'to', |
|
151 | + 'Registration Multi-status Summary' |
|
152 | 152 | ); |
153 | 153 | |
154 | 154 | //deactivate MER plugin so its not active for future tests |
155 | 155 | $I->ensurePluginDeactivated( |
156 | - 'event-espresso-mer-multi-event-registration', |
|
157 | - 'plugins deactivated' |
|
156 | + 'event-espresso-mer-multi-event-registration', |
|
157 | + 'plugins deactivated' |
|
158 | 158 | ); |
159 | 159 | \ No newline at end of file |
@@ -18,14 +18,14 @@ discard block |
||
18 | 18 | $event_one_link = $event_two_link = $event_three_link = ''; |
19 | 19 | |
20 | 20 | $I->wantTo( |
21 | - 'Test that when registrations for multiple events are completed, and those events share the same custom' |
|
22 | - . 'template, that that custom template will be used.' |
|
21 | + 'Test that when registrations for multiple events are completed, and those events share the same custom' |
|
22 | + . 'template, that that custom template will be used.' |
|
23 | 23 | ); |
24 | 24 | |
25 | 25 | //need the MER plugin active for this test (we'll deactivate it after). |
26 | 26 | $I->ensurePluginActive( |
27 | - 'event-espresso-mer-multi-event-registration', |
|
28 | - 'activated' |
|
27 | + 'event-espresso-mer-multi-event-registration', |
|
28 | + 'activated' |
|
29 | 29 | ); |
30 | 30 | |
31 | 31 | $I->loginAsAdmin(); |
@@ -80,9 +80,9 @@ discard block |
||
80 | 80 | |
81 | 81 | |
82 | 82 | $test_registration_details = array( |
83 | - 'fname' => 'CTGuy', |
|
84 | - 'lname' => 'Dude', |
|
85 | - 'email' => '[email protected]' |
|
83 | + 'fname' => 'CTGuy', |
|
84 | + 'lname' => 'Dude', |
|
85 | + 'email' => '[email protected]' |
|
86 | 86 | ); |
87 | 87 | |
88 | 88 | $I->amGoingTo('Register for Event One and Event Two and verify Custom Template A was used.'); |
@@ -108,23 +108,23 @@ discard block |
||
108 | 108 | $I->loginAsAdmin(); |
109 | 109 | $I->amOnMessagesActivityListTablePage(); |
110 | 110 | $I->viewMessageInMessagesListTableFor( |
111 | - 'Registration Approved', |
|
112 | - MessagesAdmin::MESSAGE_STATUS_SENT, |
|
113 | - 'Email', |
|
114 | - 'Registrant' |
|
111 | + 'Registration Approved', |
|
112 | + MessagesAdmin::MESSAGE_STATUS_SENT, |
|
113 | + 'Email', |
|
114 | + 'Registrant' |
|
115 | 115 | ); |
116 | 116 | $I->seeTextInViewMessageModal($custom_template_a_label); |
117 | 117 | $I->dismissMessageModal(); |
118 | 118 | $I->deleteMessageInMessagesListTableFor( |
119 | - 'Registration Approved', |
|
120 | - MessagesAdmin::MESSAGE_STATUS_SENT, |
|
121 | - 'Email', |
|
122 | - 'Registrant' |
|
119 | + 'Registration Approved', |
|
120 | + MessagesAdmin::MESSAGE_STATUS_SENT, |
|
121 | + 'Email', |
|
122 | + 'Registrant' |
|
123 | 123 | ); |
124 | 124 | |
125 | 125 | //verify admin context |
126 | 126 | $I->viewMessageInMessagesListTableFor( |
127 | - 'Registration Approved' |
|
127 | + 'Registration Approved' |
|
128 | 128 | ); |
129 | 129 | $I->seeTextInViewMessageModal($custom_template_a_label); |
130 | 130 | $I->dismissMessageModal(); |
@@ -153,25 +153,25 @@ discard block |
||
153 | 153 | $I->loginAsAdmin(); |
154 | 154 | $I->amOnMessagesActivityListTablePage(); |
155 | 155 | $I->viewMessageInMessagesListTableFor( |
156 | - 'Registration Approved', |
|
157 | - MessagesAdmin::MESSAGE_STATUS_SENT, |
|
158 | - 'Email', |
|
159 | - 'Registrant' |
|
156 | + 'Registration Approved', |
|
157 | + MessagesAdmin::MESSAGE_STATUS_SENT, |
|
158 | + 'Email', |
|
159 | + 'Registrant' |
|
160 | 160 | ); |
161 | 161 | $I->waitForElementVisible(MessagesAdmin::MESSAGES_LIST_TABLE_VIEW_MESSAGE_DIALOG_CONTAINER_SELECTOR); |
162 | 162 | $I->dontSeeTextInViewMessageModal($custom_template_a_label); |
163 | 163 | $I->dontSeeTextInViewMessageModal($custom_template_b_label); |
164 | 164 | $I->dismissMessageModal(); |
165 | 165 | $I->deleteMessageInMessagesListTableFor( |
166 | - 'Registration Approved', |
|
167 | - MessagesAdmin::MESSAGE_STATUS_SENT, |
|
168 | - 'Email', |
|
169 | - 'Registrant' |
|
166 | + 'Registration Approved', |
|
167 | + MessagesAdmin::MESSAGE_STATUS_SENT, |
|
168 | + 'Email', |
|
169 | + 'Registrant' |
|
170 | 170 | ); |
171 | 171 | |
172 | 172 | //verify admin context |
173 | 173 | $I->viewMessageInMessagesListTableFor( |
174 | - 'Registration Approved' |
|
174 | + 'Registration Approved' |
|
175 | 175 | ); |
176 | 176 | $I->waitForElementVisible(MessagesAdmin::MESSAGES_LIST_TABLE_VIEW_MESSAGE_DIALOG_CONTAINER_SELECTOR); |
177 | 177 | $I->dontSee($custom_template_a_label); |
@@ -183,6 +183,6 @@ discard block |
||
183 | 183 | |
184 | 184 | //deactivate MER plugin so its not active for future tests |
185 | 185 | $I->ensurePluginDeactivated( |
186 | - 'event-espresso-mer-multi-event-registration', |
|
187 | - 'plugins deactivated' |
|
186 | + 'event-espresso-mer-multi-event-registration', |
|
187 | + 'plugins deactivated' |
|
188 | 188 | ); |
189 | 189 | \ No newline at end of file |
@@ -15,139 +15,139 @@ |
||
15 | 15 | trait RegistrationsAdmin |
16 | 16 | { |
17 | 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) |
|
25 | - { |
|
26 | - foreach ($registration_ids as $registration_id) { |
|
27 | - $this->actor()->checkOption( |
|
28 | - RegistrationsAdminPage::listTableCheckBoxSelectorForRegistrationId($registration_id) |
|
29 | - ); |
|
30 | - } |
|
31 | - } |
|
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 = '') |
|
39 | - { |
|
40 | - $this->actor()->amOnAdminPage( |
|
41 | - RegistrationsAdminPage::registrationsDefaultAdminListTableUrl($additional_params) |
|
42 | - ); |
|
43 | - //wait for page to fully load |
|
44 | - $this->actor()->wait(5); |
|
45 | - } |
|
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) |
|
53 | - { |
|
54 | - $this->amOnDefaultRegistrationsListTableAdminPage(); |
|
55 | - $this->actor()->fillField(RegistrationsAdminPage::SEARCH_INPUT_SELECTOR_LIST_TABLE_REGISTRATION, $search_text); |
|
56 | - $this->actor()->click(CoreAdmin::LIST_TABLE_SEARCH_SUBMIT_SELECTOR); |
|
57 | - $this->actor()->waitForText('Displaying search results for'); |
|
58 | - } |
|
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) |
|
70 | - { |
|
71 | - $this->actor()->amOnDefaultEventsListTablePage(); |
|
72 | - $this->actor()->click(EventsAdmin::listTableActionLinkRegistrationsForEvent($event_id)); |
|
73 | - $this->actor()->waitForText('Viewing registrations for the event'); |
|
74 | - } |
|
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) |
|
82 | - { |
|
83 | - $this->actor()->amViewingRegistrationsForEvent($event_id); |
|
84 | - $this->actor()->click(RegistrationsAdminPage::BUTTON_ADD_NEW_REGISTRATION); |
|
85 | - $this->actor()->waitForText('Adding Registration For'); |
|
86 | - } |
|
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) |
|
95 | - { |
|
96 | - $this->actor()->click(RegistrationsAdminPage::viewDetailsLinkSelectorForRegistrationId($registration_id)); |
|
97 | - } |
|
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) |
|
109 | - { |
|
110 | - $this->actor()->selectOption( |
|
111 | - RegistrationsAdminPage::DROPDOWN_REGISTRATION_STATUS, |
|
112 | - $status_label_or_value |
|
113 | - ); |
|
114 | - } |
|
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) |
|
122 | - { |
|
123 | - $send_related_messages |
|
124 | - ? $this->actor()->selectOption( |
|
125 | - RegistrationsAdminPage::DROPDOWN_SEND_RELATED_MESSAGES, |
|
126 | - 'Yes' |
|
127 | - ) |
|
128 | - : $this->actor()->selecOption( |
|
129 | - RegistrationsAdminPage::DROPDOWN_SEND_RELATED_MESSAGES, |
|
130 | - 'No' |
|
131 | - ); |
|
132 | - } |
|
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( |
|
144 | - $status_label_or_value, |
|
145 | - $send_related_messages = true |
|
146 | - ) { |
|
147 | - $this->actor()->selectRegistrationStatusOnRegistrationDetailsPageFor($status_label_or_value); |
|
148 | - $this->actor()->selectSendRelatedMessagesOptionOnRegistrationDetailsPage($send_related_messages); |
|
149 | - $this->actor()->click(RegistrationsAdminPage::BUTTON_UPDATE_REGISTRATION_STATUS); |
|
150 | - $this->actor()->waitForText('Registration status has been set to'); |
|
151 | - } |
|
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) |
|
25 | + { |
|
26 | + foreach ($registration_ids as $registration_id) { |
|
27 | + $this->actor()->checkOption( |
|
28 | + RegistrationsAdminPage::listTableCheckBoxSelectorForRegistrationId($registration_id) |
|
29 | + ); |
|
30 | + } |
|
31 | + } |
|
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 = '') |
|
39 | + { |
|
40 | + $this->actor()->amOnAdminPage( |
|
41 | + RegistrationsAdminPage::registrationsDefaultAdminListTableUrl($additional_params) |
|
42 | + ); |
|
43 | + //wait for page to fully load |
|
44 | + $this->actor()->wait(5); |
|
45 | + } |
|
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) |
|
53 | + { |
|
54 | + $this->amOnDefaultRegistrationsListTableAdminPage(); |
|
55 | + $this->actor()->fillField(RegistrationsAdminPage::SEARCH_INPUT_SELECTOR_LIST_TABLE_REGISTRATION, $search_text); |
|
56 | + $this->actor()->click(CoreAdmin::LIST_TABLE_SEARCH_SUBMIT_SELECTOR); |
|
57 | + $this->actor()->waitForText('Displaying search results for'); |
|
58 | + } |
|
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) |
|
70 | + { |
|
71 | + $this->actor()->amOnDefaultEventsListTablePage(); |
|
72 | + $this->actor()->click(EventsAdmin::listTableActionLinkRegistrationsForEvent($event_id)); |
|
73 | + $this->actor()->waitForText('Viewing registrations for the event'); |
|
74 | + } |
|
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) |
|
82 | + { |
|
83 | + $this->actor()->amViewingRegistrationsForEvent($event_id); |
|
84 | + $this->actor()->click(RegistrationsAdminPage::BUTTON_ADD_NEW_REGISTRATION); |
|
85 | + $this->actor()->waitForText('Adding Registration For'); |
|
86 | + } |
|
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) |
|
95 | + { |
|
96 | + $this->actor()->click(RegistrationsAdminPage::viewDetailsLinkSelectorForRegistrationId($registration_id)); |
|
97 | + } |
|
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) |
|
109 | + { |
|
110 | + $this->actor()->selectOption( |
|
111 | + RegistrationsAdminPage::DROPDOWN_REGISTRATION_STATUS, |
|
112 | + $status_label_or_value |
|
113 | + ); |
|
114 | + } |
|
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) |
|
122 | + { |
|
123 | + $send_related_messages |
|
124 | + ? $this->actor()->selectOption( |
|
125 | + RegistrationsAdminPage::DROPDOWN_SEND_RELATED_MESSAGES, |
|
126 | + 'Yes' |
|
127 | + ) |
|
128 | + : $this->actor()->selecOption( |
|
129 | + RegistrationsAdminPage::DROPDOWN_SEND_RELATED_MESSAGES, |
|
130 | + 'No' |
|
131 | + ); |
|
132 | + } |
|
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( |
|
144 | + $status_label_or_value, |
|
145 | + $send_related_messages = true |
|
146 | + ) { |
|
147 | + $this->actor()->selectRegistrationStatusOnRegistrationDetailsPageFor($status_label_or_value); |
|
148 | + $this->actor()->selectSendRelatedMessagesOptionOnRegistrationDetailsPage($send_related_messages); |
|
149 | + $this->actor()->click(RegistrationsAdminPage::BUTTON_UPDATE_REGISTRATION_STATUS); |
|
150 | + $this->actor()->waitForText('Registration status has been set to'); |
|
151 | + } |
|
152 | 152 | |
153 | 153 | } |
154 | 154 | \ No newline at end of file |
@@ -13,75 +13,75 @@ |
||
13 | 13 | */ |
14 | 14 | trait Checkout |
15 | 15 | { |
16 | - /** |
|
17 | - * @param $value |
|
18 | - * @param int $attendee_number |
|
19 | - * @param bool $admin Used to indicate whether we're filling out the field from the context of the admin or not. |
|
20 | - */ |
|
21 | - public function fillOutFirstNameFieldForAttendee($value, $attendee_number = 1, $admin = false) |
|
22 | - { |
|
23 | - $this->actor()->fillField(CheckoutPage::firstNameFieldSelectorForAttendeeNumber($attendee_number, $admin), $value); |
|
24 | - } |
|
16 | + /** |
|
17 | + * @param $value |
|
18 | + * @param int $attendee_number |
|
19 | + * @param bool $admin Used to indicate whether we're filling out the field from the context of the admin or not. |
|
20 | + */ |
|
21 | + public function fillOutFirstNameFieldForAttendee($value, $attendee_number = 1, $admin = false) |
|
22 | + { |
|
23 | + $this->actor()->fillField(CheckoutPage::firstNameFieldSelectorForAttendeeNumber($attendee_number, $admin), $value); |
|
24 | + } |
|
25 | 25 | |
26 | - /** |
|
27 | - * @param $value |
|
28 | - * @param int $attendee_number |
|
29 | - * @param bool $admin Used to indicate whether we're filling out the field from the context of the admin or not. |
|
30 | - */ |
|
31 | - public function fillOutLastNameFieldForAttendee($value, $attendee_number = 1, $admin = false) |
|
32 | - { |
|
33 | - $this->actor()->fillField(CheckoutPage::lastNameFieldSelectorForAttendeeNumber($attendee_number, $admin), $value); |
|
34 | - } |
|
26 | + /** |
|
27 | + * @param $value |
|
28 | + * @param int $attendee_number |
|
29 | + * @param bool $admin Used to indicate whether we're filling out the field from the context of the admin or not. |
|
30 | + */ |
|
31 | + public function fillOutLastNameFieldForAttendee($value, $attendee_number = 1, $admin = false) |
|
32 | + { |
|
33 | + $this->actor()->fillField(CheckoutPage::lastNameFieldSelectorForAttendeeNumber($attendee_number, $admin), $value); |
|
34 | + } |
|
35 | 35 | |
36 | - /** |
|
37 | - * @param $value |
|
38 | - * @param int $attendee_number |
|
39 | - * @param bool $admin Used to indicate whether we're filling out the field from the context of the admin or not. |
|
40 | - */ |
|
41 | - public function fillOutEmailFieldForAttendee($value, $attendee_number = 1, $admin = false) |
|
42 | - { |
|
43 | - $this->actor()->fillField(CheckoutPage::emailFieldSelectorForAttendeeNumber($attendee_number, $admin), $value); |
|
44 | - } |
|
36 | + /** |
|
37 | + * @param $value |
|
38 | + * @param int $attendee_number |
|
39 | + * @param bool $admin Used to indicate whether we're filling out the field from the context of the admin or not. |
|
40 | + */ |
|
41 | + public function fillOutEmailFieldForAttendee($value, $attendee_number = 1, $admin = false) |
|
42 | + { |
|
43 | + $this->actor()->fillField(CheckoutPage::emailFieldSelectorForAttendeeNumber($attendee_number, $admin), $value); |
|
44 | + } |
|
45 | 45 | |
46 | 46 | |
47 | - /** |
|
48 | - * Clicks the next registration step button. |
|
49 | - */ |
|
50 | - public function goToNextRegistrationStep() |
|
51 | - { |
|
52 | - $this->actor()->click(CheckoutPage::NEXT_STEP_BUTTON_SELECTOR); |
|
53 | - } |
|
47 | + /** |
|
48 | + * Clicks the next registration step button. |
|
49 | + */ |
|
50 | + public function goToNextRegistrationStep() |
|
51 | + { |
|
52 | + $this->actor()->click(CheckoutPage::NEXT_STEP_BUTTON_SELECTOR); |
|
53 | + } |
|
54 | 54 | |
55 | 55 | |
56 | - /** |
|
57 | - * Selects the payment option for the given payment method slug. |
|
58 | - * |
|
59 | - * @param string $payment_method_slug |
|
60 | - * @param bool $verify_selected If true, this will wait for the "Important Information" info box after the |
|
61 | - * payment option select box is complete. Otherwise its up to calling code to |
|
62 | - * wait for whatever is needed after selecting the payment method. |
|
63 | - */ |
|
64 | - public function selectPaymentOptionFor($payment_method_slug = 'invoice', $verify_selected = true) |
|
65 | - { |
|
66 | - $this->waitForElementVisible(CheckoutPage::SELECTOR_PAYMENT_OPTIONS_CONTAINER); |
|
67 | - $this->wait(5); |
|
68 | - $this->actor()->selectOption( |
|
69 | - CheckoutPage::PAYMENT_METHOD_STEP_FORM, |
|
70 | - $payment_method_slug |
|
71 | - ); |
|
72 | - if ($verify_selected) { |
|
73 | - $this->actor()->waitForText('Important information regarding your payment'); |
|
74 | - } |
|
75 | - } |
|
56 | + /** |
|
57 | + * Selects the payment option for the given payment method slug. |
|
58 | + * |
|
59 | + * @param string $payment_method_slug |
|
60 | + * @param bool $verify_selected If true, this will wait for the "Important Information" info box after the |
|
61 | + * payment option select box is complete. Otherwise its up to calling code to |
|
62 | + * wait for whatever is needed after selecting the payment method. |
|
63 | + */ |
|
64 | + public function selectPaymentOptionFor($payment_method_slug = 'invoice', $verify_selected = true) |
|
65 | + { |
|
66 | + $this->waitForElementVisible(CheckoutPage::SELECTOR_PAYMENT_OPTIONS_CONTAINER); |
|
67 | + $this->wait(5); |
|
68 | + $this->actor()->selectOption( |
|
69 | + CheckoutPage::PAYMENT_METHOD_STEP_FORM, |
|
70 | + $payment_method_slug |
|
71 | + ); |
|
72 | + if ($verify_selected) { |
|
73 | + $this->actor()->waitForText('Important information regarding your payment'); |
|
74 | + } |
|
75 | + } |
|
76 | 76 | |
77 | 77 | |
78 | - /** |
|
79 | - * Submits the payment options step form. |
|
80 | - * Assumes the actor is in the context of the payment options SPCO step. |
|
81 | - */ |
|
82 | - public function submitPaymentOptionsRegistrationStepForm() |
|
83 | - { |
|
84 | - $this->actor()->submitForm(CheckoutPage::PAYMENT_METHOD_STEP_FORM, array()); |
|
85 | - } |
|
78 | + /** |
|
79 | + * Submits the payment options step form. |
|
80 | + * Assumes the actor is in the context of the payment options SPCO step. |
|
81 | + */ |
|
82 | + public function submitPaymentOptionsRegistrationStepForm() |
|
83 | + { |
|
84 | + $this->actor()->submitForm(CheckoutPage::PAYMENT_METHOD_STEP_FORM, array()); |
|
85 | + } |
|
86 | 86 | |
87 | 87 | } |
88 | 88 | \ No newline at end of file |
@@ -12,27 +12,27 @@ |
||
12 | 12 | class TicketSelector |
13 | 13 | { |
14 | 14 | |
15 | - /** |
|
16 | - * Return the selector for the ticket option select input for the given event id. |
|
17 | - * @param int|string $event_id |
|
18 | - * @return string |
|
19 | - */ |
|
20 | - public static function ticketOptionByEventIdSelector($event_id) |
|
21 | - { |
|
22 | - return "//select[@id='ticket-selector-tbl-qty-slct-$event_id-1']"; |
|
23 | - } |
|
15 | + /** |
|
16 | + * Return the selector for the ticket option select input for the given event id. |
|
17 | + * @param int|string $event_id |
|
18 | + * @return string |
|
19 | + */ |
|
20 | + public static function ticketOptionByEventIdSelector($event_id) |
|
21 | + { |
|
22 | + return "//select[@id='ticket-selector-tbl-qty-slct-$event_id-1']"; |
|
23 | + } |
|
24 | 24 | |
25 | 25 | |
26 | - /** |
|
27 | - * Return the selector for the submit button for the ticket selector for the given event id. |
|
28 | - * @param int|string $event_id |
|
29 | - * @param bool $admin Used to return the selector from the context of the admin (true) or frontend (false) |
|
30 | - * @return string |
|
31 | - */ |
|
32 | - public static function ticketSelectionSubmitSelectorByEventId($event_id, $admin = false) |
|
33 | - { |
|
34 | - return $admin |
|
35 | - ? "#ee-new-registration-step-button" |
|
36 | - : "#ticket-selector-submit-$event_id-btn"; |
|
37 | - } |
|
26 | + /** |
|
27 | + * Return the selector for the submit button for the ticket selector for the given event id. |
|
28 | + * @param int|string $event_id |
|
29 | + * @param bool $admin Used to return the selector from the context of the admin (true) or frontend (false) |
|
30 | + * @return string |
|
31 | + */ |
|
32 | + public static function ticketSelectionSubmitSelectorByEventId($event_id, $admin = false) |
|
33 | + { |
|
34 | + return $admin |
|
35 | + ? "#ee-new-registration-step-button" |
|
36 | + : "#ticket-selector-submit-$event_id-btn"; |
|
37 | + } |
|
38 | 38 | } |
39 | 39 | \ No newline at end of file |
@@ -12,47 +12,47 @@ |
||
12 | 12 | class RegistrationsAdmin extends CoreAdmin |
13 | 13 | { |
14 | 14 | |
15 | - const REGISTRATION_STATUS_NOT_APPROVED = 'RNA'; |
|
16 | - const REGISTRATION_STATUS_APPROVED = 'RAP'; |
|
17 | - const REGISTRATION_STATUS_PENDING_PAYMENT = 'RPP'; |
|
18 | - const SEARCH_INPUT_SELECTOR_LIST_TABLE_REGISTRATION = '#event-espresso_page_espresso_registrations-search-input'; |
|
19 | - const BUTTON_ADD_NEW_REGISTRATION = '#add-new-registration'; |
|
20 | - const DROPDOWN_REGISTRATION_STATUS = '#reg-status-change-form-reg-status'; |
|
21 | - const BUTTON_UPDATE_REGISTRATION_STATUS = '#reg-status-change-form-submit-submit'; |
|
22 | - const DROPDOWN_SEND_RELATED_MESSAGES = '#reg-status-change-form-send-notifications'; |
|
23 | - |
|
24 | - |
|
25 | - /** |
|
26 | - * @param string $additional_params |
|
27 | - * @return string |
|
28 | - */ |
|
29 | - public static function registrationsDefaultAdminListTableUrl($additional_params = '') |
|
30 | - { |
|
31 | - return self::adminUrl('espresso_registrations', 'default', $additional_params); |
|
32 | - } |
|
33 | - |
|
34 | - |
|
35 | - /** |
|
36 | - * Given a registration id, this will return the selector for all the checkbox for that id. |
|
37 | - * Assumes the view is the default registrations list table. |
|
38 | - * @param int $registration_id |
|
39 | - * @return string |
|
40 | - */ |
|
41 | - public static function listTableCheckBoxSelectorForRegistrationId($registration_id) |
|
42 | - { |
|
43 | - return "//input[@name='_REG_ID[]' and @value='{$registration_id}']"; |
|
44 | - } |
|
45 | - |
|
46 | - |
|
47 | - /** |
|
48 | - * Given a registration id, this will return the selector for the link to the registration details. |
|
49 | - * Assumes the view is the default registrations list table. |
|
50 | - * @param int $registration_id |
|
51 | - * @return string |
|
52 | - */ |
|
53 | - public static function viewDetailsLinkSelectorForRegistrationId($registration_id) |
|
54 | - { |
|
55 | - return "//tbody[@id='the-list']/tr/td[contains(@class, 'column-_REG_ID') and contains(., $registration_id)]" |
|
56 | - . "//ancestor::tr/td[contains(@class, 'column-ATT_fname')]/a[1]"; |
|
57 | - } |
|
15 | + const REGISTRATION_STATUS_NOT_APPROVED = 'RNA'; |
|
16 | + const REGISTRATION_STATUS_APPROVED = 'RAP'; |
|
17 | + const REGISTRATION_STATUS_PENDING_PAYMENT = 'RPP'; |
|
18 | + const SEARCH_INPUT_SELECTOR_LIST_TABLE_REGISTRATION = '#event-espresso_page_espresso_registrations-search-input'; |
|
19 | + const BUTTON_ADD_NEW_REGISTRATION = '#add-new-registration'; |
|
20 | + const DROPDOWN_REGISTRATION_STATUS = '#reg-status-change-form-reg-status'; |
|
21 | + const BUTTON_UPDATE_REGISTRATION_STATUS = '#reg-status-change-form-submit-submit'; |
|
22 | + const DROPDOWN_SEND_RELATED_MESSAGES = '#reg-status-change-form-send-notifications'; |
|
23 | + |
|
24 | + |
|
25 | + /** |
|
26 | + * @param string $additional_params |
|
27 | + * @return string |
|
28 | + */ |
|
29 | + public static function registrationsDefaultAdminListTableUrl($additional_params = '') |
|
30 | + { |
|
31 | + return self::adminUrl('espresso_registrations', 'default', $additional_params); |
|
32 | + } |
|
33 | + |
|
34 | + |
|
35 | + /** |
|
36 | + * Given a registration id, this will return the selector for all the checkbox for that id. |
|
37 | + * Assumes the view is the default registrations list table. |
|
38 | + * @param int $registration_id |
|
39 | + * @return string |
|
40 | + */ |
|
41 | + public static function listTableCheckBoxSelectorForRegistrationId($registration_id) |
|
42 | + { |
|
43 | + return "//input[@name='_REG_ID[]' and @value='{$registration_id}']"; |
|
44 | + } |
|
45 | + |
|
46 | + |
|
47 | + /** |
|
48 | + * Given a registration id, this will return the selector for the link to the registration details. |
|
49 | + * Assumes the view is the default registrations list table. |
|
50 | + * @param int $registration_id |
|
51 | + * @return string |
|
52 | + */ |
|
53 | + public static function viewDetailsLinkSelectorForRegistrationId($registration_id) |
|
54 | + { |
|
55 | + return "//tbody[@id='the-list']/tr/td[contains(@class, 'column-_REG_ID') and contains(., $registration_id)]" |
|
56 | + . "//ancestor::tr/td[contains(@class, 'column-ATT_fname')]/a[1]"; |
|
57 | + } |
|
58 | 58 | } |
59 | 59 | \ No newline at end of file |