Completed
Branch FET-10724-event-editor-cleanup (09bcbe)
by
unknown
196:42 queued 184:44
created
acceptance_tests/Helpers/BaseCoreAdmin.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -13,25 +13,25 @@
 block discarded – undo
13 13
 trait BaseCoreAdmin
14 14
 {
15 15
 
16
-    /**
17
-     * Core method for going to an Event Espresso Admin page.
18
-     * @param string $page
19
-     * @param string $action
20
-     * @param string $additional_params
21
-     */
22
-    public function amOnEventEspressoAdminPage($page = '', $action = '', $additional_params = '')
23
-    {
24
-        $this->actor()->amOnAdminPage(CoreAdmin::adminUrl($page, $action, $additional_params));
25
-    }
16
+	/**
17
+	 * Core method for going to an Event Espresso Admin page.
18
+	 * @param string $page
19
+	 * @param string $action
20
+	 * @param string $additional_params
21
+	 */
22
+	public function amOnEventEspressoAdminPage($page = '', $action = '', $additional_params = '')
23
+	{
24
+		$this->actor()->amOnAdminPage(CoreAdmin::adminUrl($page, $action, $additional_params));
25
+	}
26 26
 
27 27
 
28
-    /**
29
-     * Helper method for returning an instance of the Actor.  Intended to help with IDE fill out of methods.
30
-     * @return \EventEspressoAcceptanceTester;
31
-     */
32
-    protected function actor()
33
-    {
34
-        /** @var \EventEspressoAcceptanceTester $this */
35
-        return $this;
36
-    }
28
+	/**
29
+	 * Helper method for returning an instance of the Actor.  Intended to help with IDE fill out of methods.
30
+	 * @return \EventEspressoAcceptanceTester;
31
+	 */
32
+	protected function actor()
33
+	{
34
+		/** @var \EventEspressoAcceptanceTester $this */
35
+		return $this;
36
+	}
37 37
 }
38 38
\ No newline at end of file
Please login to merge, or discard this patch.
acceptance_tests/Helpers/Checkout.php 1 patch
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -13,39 +13,39 @@
 block discarded – undo
13 13
  */
14 14
 trait Checkout
15 15
 {
16
-    /**
17
-     * @param     $value
18
-     * @param int $attendee_number
19
-     */
20
-    public function fillOutFirstNameFieldForAttendee($value, $attendee_number = 1)
21
-    {
22
-        $this->actor()->fillField(CheckoutPage::firstNameFieldSelectorForAttendeeNumber($attendee_number), $value);
23
-    }
24
-
25
-    /**
26
-     * @param     $value
27
-     * @param int $attendee_number
28
-     */
29
-    public function fillOutLastNameFieldForAttendee($value, $attendee_number = 1)
30
-    {
31
-        $this->actor()->fillField(CheckoutPage::lastNameFieldSelectorForAttendeeNumber($attendee_number), $value);
32
-    }
33
-
34
-    /**
35
-     * @param     $value
36
-     * @param int $attendee_number
37
-     */
38
-    public function fillOutEmailFieldForAttendee($value, $attendee_number = 1)
39
-    {
40
-        $this->actor()->fillField(CheckoutPage::emailFieldSelectorForAttendeeNumber($attendee_number), $value);
41
-    }
42
-
43
-
44
-    /**
45
-     * Clicks the next registration step button.
46
-     */
47
-    public function goToNextRegistrationStep()
48
-    {
49
-        $this->actor()->click(CheckoutPage::NEXT_STEP_BUTTON_SELECTOR);
50
-    }
16
+	/**
17
+	 * @param     $value
18
+	 * @param int $attendee_number
19
+	 */
20
+	public function fillOutFirstNameFieldForAttendee($value, $attendee_number = 1)
21
+	{
22
+		$this->actor()->fillField(CheckoutPage::firstNameFieldSelectorForAttendeeNumber($attendee_number), $value);
23
+	}
24
+
25
+	/**
26
+	 * @param     $value
27
+	 * @param int $attendee_number
28
+	 */
29
+	public function fillOutLastNameFieldForAttendee($value, $attendee_number = 1)
30
+	{
31
+		$this->actor()->fillField(CheckoutPage::lastNameFieldSelectorForAttendeeNumber($attendee_number), $value);
32
+	}
33
+
34
+	/**
35
+	 * @param     $value
36
+	 * @param int $attendee_number
37
+	 */
38
+	public function fillOutEmailFieldForAttendee($value, $attendee_number = 1)
39
+	{
40
+		$this->actor()->fillField(CheckoutPage::emailFieldSelectorForAttendeeNumber($attendee_number), $value);
41
+	}
42
+
43
+
44
+	/**
45
+	 * Clicks the next registration step button.
46
+	 */
47
+	public function goToNextRegistrationStep()
48
+	{
49
+		$this->actor()->click(CheckoutPage::NEXT_STEP_BUTTON_SELECTOR);
50
+	}
51 51
 }
52 52
\ No newline at end of file
Please login to merge, or discard this patch.
acceptance_tests/Page/Checkout.php 1 patch
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -13,48 +13,48 @@
 block discarded – undo
13 13
 class Checkout
14 14
 {
15 15
 
16
-    /**
17
-     * The class selector for the next step button in the checkout.
18
-     * @var string
19
-     */
20
-    const NEXT_STEP_BUTTON_SELECTOR = '.spco-next-step-btn';
21
-
22
-    /**
23
-     * @param int $attendee_number
24
-     * @return string
25
-     */
26
-    public static function firstNameFieldSelectorForAttendeeNumber($attendee_number = 1)
27
-    {
28
-        return self::fieldSelectorForAttendeeNumber('fname', $attendee_number);
29
-    }
30
-
31
-
32
-    /**
33
-     * @param int $attendee_number
34
-     * @return string
35
-     */
36
-    public static function lastNameFieldSelectorForAttendeeNumber($attendee_number = 1)
37
-    {
38
-        return self::fieldSelectorForAttendeeNumber('lname', $attendee_number);
39
-    }
40
-
41
-
42
-    /**
43
-     * @param int $attendee_number
44
-     * @return string
45
-     */
46
-    public static function emailFieldSelectorForAttendeeNumber($attendee_number = 1)
47
-    {
48
-        return self::fieldSelectorForAttendeeNumber('email', $attendee_number);
49
-    }
50
-
51
-    /**
52
-     * @param     $field_name
53
-     * @param int $attendee_number
54
-     * @return string
55
-     */
56
-    public static function fieldSelectorForAttendeeNumber($field_name, $attendee_number = 1)
57
-    {
58
-        return "//div[starts-with(@id, 'spco-attendee-panel-dv-$attendee_number')]//input[contains(@class, 'ee-reg-qstn-$field_name')]";
59
-    }
16
+	/**
17
+	 * The class selector for the next step button in the checkout.
18
+	 * @var string
19
+	 */
20
+	const NEXT_STEP_BUTTON_SELECTOR = '.spco-next-step-btn';
21
+
22
+	/**
23
+	 * @param int $attendee_number
24
+	 * @return string
25
+	 */
26
+	public static function firstNameFieldSelectorForAttendeeNumber($attendee_number = 1)
27
+	{
28
+		return self::fieldSelectorForAttendeeNumber('fname', $attendee_number);
29
+	}
30
+
31
+
32
+	/**
33
+	 * @param int $attendee_number
34
+	 * @return string
35
+	 */
36
+	public static function lastNameFieldSelectorForAttendeeNumber($attendee_number = 1)
37
+	{
38
+		return self::fieldSelectorForAttendeeNumber('lname', $attendee_number);
39
+	}
40
+
41
+
42
+	/**
43
+	 * @param int $attendee_number
44
+	 * @return string
45
+	 */
46
+	public static function emailFieldSelectorForAttendeeNumber($attendee_number = 1)
47
+	{
48
+		return self::fieldSelectorForAttendeeNumber('email', $attendee_number);
49
+	}
50
+
51
+	/**
52
+	 * @param     $field_name
53
+	 * @param int $attendee_number
54
+	 * @return string
55
+	 */
56
+	public static function fieldSelectorForAttendeeNumber($field_name, $attendee_number = 1)
57
+	{
58
+		return "//div[starts-with(@id, 'spco-attendee-panel-dv-$attendee_number')]//input[contains(@class, 'ee-reg-qstn-$field_name')]";
59
+	}
60 60
 }
Please login to merge, or discard this patch.
acceptance_tests/Page/MessagesAdmin.php 2 patches
Indentation   +125 added lines, -125 removed lines patch added patch discarded remove patch
@@ -12,130 +12,130 @@
 block discarded – undo
12 12
 class MessagesAdmin extends CoreAdmin
13 13
 {
14 14
 
15
-    /**
16
-     * Context slug for the admin messages context.
17
-     * @var string
18
-     */
19
-    const ADMIN_CONTEXT_SLUG = 'admin';
20
-
21
-    /**
22
-     * Context slug for the primary attendee messages context
23
-     * @var string
24
-     */
25
-    const PRIMARY_ATTENDEE_CONTEXT_SLUG = 'primary_attendee';
26
-
27
-
28
-    /**
29
-     * Status reference for the EEM_Message::status_sent status.
30
-     * @var string
31
-     */
32
-    const MESSAGE_STATUS_SENT = 'MSN';
33
-
34
-
35
-    /**
36
-     * Message type slug for the Payment Failed message type
37
-     */
38
-    const PAYMENT_FAILED_MESSAGE_TYPE_SLUG = 'payment_failed';
39
-
40
-
41
-    /**
42
-     * Selector for the Global Messages "Send on same request" field in the Messages Settings tab.
43
-     * @var string
44
-     */
45
-    const GLOBAL_MESSAGES_SETTINGS_ON_REQUEST_SELECTION_SELECTOR = '#global_messages_settings-do-messages-on-same-request';
46
-
47
-
48
-    /**
49
-     * Selector for the Global Messages Settings submit button in the Messages Settings tab.
50
-     * @var string
51
-     */
52
-    const GLOBAL_MESSAGES_SETTINGS_SUBMIT_SELECTOR = '#global_messages_settings-update-settings-submit';
53
-
54
-
55
-
56
-    /**
57
-     * @param string $additional_params Any additional request parameters for the generated url should be included as
58
-     *                                  a string.
59
-     * @return string
60
-     */
61
-    public static function messageActivityListTableUrl($additional_params = '')
62
-    {
63
-        return self::adminUrl('espresso_messages', 'default', $additional_params);
64
-    }
65
-
66
-
67
-    /**
68
-     * @param string $additional_params Any additional request parameters for the generated url should be included as
69
-     *                                  a string.
70
-     * @return string
71
-     */
72
-    public static function defaultMessageTemplateListTableUrl($additional_params = '')
73
-    {
74
-        return self::adminUrl('espresso_messages', 'global_mtps', $additional_params);
75
-    }
76
-
77
-
78
-    /**
79
-     * @param string $additional_params Any additional request parameters for the generated url should be included as
80
-     *                                  a string.
81
-     * @return string
82
-     */
83
-    public static function customMessageTemplateListTableUrl($additional_params = '')
84
-    {
85
-        return self::adminUrl('espresso_messages', 'custom_mtps', $additional_params);
86
-    }
87
-
88
-
89
-    /**
90
-     * @return string
91
-     */
92
-    public static function messageSettingsUrl()
93
-    {
94
-        return self::adminUrl('espresso_messages', 'settings');
95
-    }
96
-
97
-
98
-    /**
99
-     * @param string $message_type_slug
100
-     * @param string $context
101
-     * @return string
102
-     */
103
-    public static function editMessageTemplateClassByMessageType($message_type_slug, $context = '')
104
-    {
105
-        return $context
106
-            ? '.' . $message_type_slug . '-' . $context . '-edit-link'
107
-            : '.' . $message_type_slug . '-edit-link';
108
-    }
109
-
110
-
111
-    /**
112
-     * Selector for (a) specific table cell(s) in the Messages Activity list table for the given parameters.
113
-     * @param        $field
114
-     * @param        $message_type_label
115
-     * @param string $message_status
116
-     * @param string $messenger
117
-     * @param string $context
118
-     * @param string $table_cell_content_for_field
119
-     * @return string
120
-     */
121
-    public static function messagesActivityListTableCellSelectorFor(
122
-        $field,
123
-        $message_type_label,
124
-        $message_status = self::MESSAGE_STATUS_SENT,
125
-        $messenger = 'Email',
126
-        $context = 'Event Admin',
127
-        $table_cell_content_for_field = ''
128
-    ) {
129
-        $selector = "//tr[contains(@class, 'msg-status-$message_status')]"
130
-                . "//td[contains(@class, 'message_type') and text()='$message_type_label']";
131
-        if ($messenger) {
132
-            $selector .= "/ancestor::tr/td[contains(@class, 'messenger') and text()='$messenger']";
133
-        }
134
-        $selector .= "/ancestor::tr/td[contains(@class, 'column-context') and text()='$context']";
135
-        $selector .= $table_cell_content_for_field
136
-            ? "/ancestor::tr/td[contains(@class, 'column-$field') and text()='$table_cell_content_for_field']"
137
-            : "/ancestor::tr/td[contains(@class, 'column-$field')]";
138
-        return $selector;
139
-    }
15
+	/**
16
+	 * Context slug for the admin messages context.
17
+	 * @var string
18
+	 */
19
+	const ADMIN_CONTEXT_SLUG = 'admin';
20
+
21
+	/**
22
+	 * Context slug for the primary attendee messages context
23
+	 * @var string
24
+	 */
25
+	const PRIMARY_ATTENDEE_CONTEXT_SLUG = 'primary_attendee';
26
+
27
+
28
+	/**
29
+	 * Status reference for the EEM_Message::status_sent status.
30
+	 * @var string
31
+	 */
32
+	const MESSAGE_STATUS_SENT = 'MSN';
33
+
34
+
35
+	/**
36
+	 * Message type slug for the Payment Failed message type
37
+	 */
38
+	const PAYMENT_FAILED_MESSAGE_TYPE_SLUG = 'payment_failed';
39
+
40
+
41
+	/**
42
+	 * Selector for the Global Messages "Send on same request" field in the Messages Settings tab.
43
+	 * @var string
44
+	 */
45
+	const GLOBAL_MESSAGES_SETTINGS_ON_REQUEST_SELECTION_SELECTOR = '#global_messages_settings-do-messages-on-same-request';
46
+
47
+
48
+	/**
49
+	 * Selector for the Global Messages Settings submit button in the Messages Settings tab.
50
+	 * @var string
51
+	 */
52
+	const GLOBAL_MESSAGES_SETTINGS_SUBMIT_SELECTOR = '#global_messages_settings-update-settings-submit';
53
+
54
+
55
+
56
+	/**
57
+	 * @param string $additional_params Any additional request parameters for the generated url should be included as
58
+	 *                                  a string.
59
+	 * @return string
60
+	 */
61
+	public static function messageActivityListTableUrl($additional_params = '')
62
+	{
63
+		return self::adminUrl('espresso_messages', 'default', $additional_params);
64
+	}
65
+
66
+
67
+	/**
68
+	 * @param string $additional_params Any additional request parameters for the generated url should be included as
69
+	 *                                  a string.
70
+	 * @return string
71
+	 */
72
+	public static function defaultMessageTemplateListTableUrl($additional_params = '')
73
+	{
74
+		return self::adminUrl('espresso_messages', 'global_mtps', $additional_params);
75
+	}
76
+
77
+
78
+	/**
79
+	 * @param string $additional_params Any additional request parameters for the generated url should be included as
80
+	 *                                  a string.
81
+	 * @return string
82
+	 */
83
+	public static function customMessageTemplateListTableUrl($additional_params = '')
84
+	{
85
+		return self::adminUrl('espresso_messages', 'custom_mtps', $additional_params);
86
+	}
87
+
88
+
89
+	/**
90
+	 * @return string
91
+	 */
92
+	public static function messageSettingsUrl()
93
+	{
94
+		return self::adminUrl('espresso_messages', 'settings');
95
+	}
96
+
97
+
98
+	/**
99
+	 * @param string $message_type_slug
100
+	 * @param string $context
101
+	 * @return string
102
+	 */
103
+	public static function editMessageTemplateClassByMessageType($message_type_slug, $context = '')
104
+	{
105
+		return $context
106
+			? '.' . $message_type_slug . '-' . $context . '-edit-link'
107
+			: '.' . $message_type_slug . '-edit-link';
108
+	}
109
+
110
+
111
+	/**
112
+	 * Selector for (a) specific table cell(s) in the Messages Activity list table for the given parameters.
113
+	 * @param        $field
114
+	 * @param        $message_type_label
115
+	 * @param string $message_status
116
+	 * @param string $messenger
117
+	 * @param string $context
118
+	 * @param string $table_cell_content_for_field
119
+	 * @return string
120
+	 */
121
+	public static function messagesActivityListTableCellSelectorFor(
122
+		$field,
123
+		$message_type_label,
124
+		$message_status = self::MESSAGE_STATUS_SENT,
125
+		$messenger = 'Email',
126
+		$context = 'Event Admin',
127
+		$table_cell_content_for_field = ''
128
+	) {
129
+		$selector = "//tr[contains(@class, 'msg-status-$message_status')]"
130
+				. "//td[contains(@class, 'message_type') and text()='$message_type_label']";
131
+		if ($messenger) {
132
+			$selector .= "/ancestor::tr/td[contains(@class, 'messenger') and text()='$messenger']";
133
+		}
134
+		$selector .= "/ancestor::tr/td[contains(@class, 'column-context') and text()='$context']";
135
+		$selector .= $table_cell_content_for_field
136
+			? "/ancestor::tr/td[contains(@class, 'column-$field') and text()='$table_cell_content_for_field']"
137
+			: "/ancestor::tr/td[contains(@class, 'column-$field')]";
138
+		return $selector;
139
+	}
140 140
 
141 141
 }
142 142
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -103,8 +103,8 @@
 block discarded – undo
103 103
     public static function editMessageTemplateClassByMessageType($message_type_slug, $context = '')
104 104
     {
105 105
         return $context
106
-            ? '.' . $message_type_slug . '-' . $context . '-edit-link'
107
-            : '.' . $message_type_slug . '-edit-link';
106
+            ? '.'.$message_type_slug.'-'.$context.'-edit-link'
107
+            : '.'.$message_type_slug.'-edit-link';
108 108
     }
109 109
 
110 110
 
Please login to merge, or discard this patch.
acceptance_tests/Page/TicketSelector.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -12,24 +12,24 @@
 block discarded – undo
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
-     * @return string
30
-     */
31
-    public static function ticketSelectionSubmitSelectorByEventId($event_id)
32
-    {
33
-        return "#ticket-selector-submit-$event_id-btn";
34
-    }
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
+	 * @return string
30
+	 */
31
+	public static function ticketSelectionSubmitSelectorByEventId($event_id)
32
+	{
33
+		return "#ticket-selector-submit-$event_id-btn";
34
+	}
35 35
 }
36 36
\ No newline at end of file
Please login to merge, or discard this patch.
acceptance_tests/Helpers/EventsAdmin.php 1 patch
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -14,51 +14,51 @@
 block discarded – undo
14 14
 trait EventsAdmin
15 15
 {
16 16
 
17
-    /**
18
-     * @param string $additional_params
19
-     */
20
-    public function amOnDefaultEventsListTablePage($additional_params = '')
21
-    {
22
-        $this->actor()->amOnAdminPage(EventsPage::defaultEventsListTableUrl($additional_params));
23
-    }
17
+	/**
18
+	 * @param string $additional_params
19
+	 */
20
+	public function amOnDefaultEventsListTablePage($additional_params = '')
21
+	{
22
+		$this->actor()->amOnAdminPage(EventsPage::defaultEventsListTableUrl($additional_params));
23
+	}
24 24
 
25 25
 
26
-    /**
27
-     * Triggers the publishing of the Event.
28
-     */
29
-    public function publishEvent()
30
-    {
31
-        $this->actor()->click(EventsPage::EVENT_EDITOR_PUBLISH_BUTTON_SELECTOR);
32
-    }
26
+	/**
27
+	 * Triggers the publishing of the Event.
28
+	 */
29
+	public function publishEvent()
30
+	{
31
+		$this->actor()->click(EventsPage::EVENT_EDITOR_PUBLISH_BUTTON_SELECTOR);
32
+	}
33 33
 
34 34
 
35
-    /**
36
-     * Navigates the actor to the event list table page and will attempt to edit the event for the given title.
37
-     * First this will search using the given title and then attempt to edit from the results of the search.
38
-     *
39
-     * Assumes actor is already logged in.
40
-     * @param $event_title
41
-     */
42
-    public function amEditingTheEventWithTitle($event_title)
43
-    {
44
-        $this->amOnDefaultEventsListTablePage();
45
-        $this->actor()->fillField(EventsPage::EVENT_LIST_TABLE_SEARCH_INPUT_SELECTOR, $event_title);
46
-        $this->actor()->click(CoreAdmin::LIST_TABLE_SEARCH_SUBMIT_SELECTOR);
47
-        $this->actor()->waitForText('Displaying search results for');
48
-        $this->actor()->click(EventsPage::eventListTableEventTitleEditLink($event_title));
49
-    }
35
+	/**
36
+	 * Navigates the actor to the event list table page and will attempt to edit the event for the given title.
37
+	 * First this will search using the given title and then attempt to edit from the results of the search.
38
+	 *
39
+	 * Assumes actor is already logged in.
40
+	 * @param $event_title
41
+	 */
42
+	public function amEditingTheEventWithTitle($event_title)
43
+	{
44
+		$this->amOnDefaultEventsListTablePage();
45
+		$this->actor()->fillField(EventsPage::EVENT_LIST_TABLE_SEARCH_INPUT_SELECTOR, $event_title);
46
+		$this->actor()->click(CoreAdmin::LIST_TABLE_SEARCH_SUBMIT_SELECTOR);
47
+		$this->actor()->waitForText('Displaying search results for');
48
+		$this->actor()->click(EventsPage::eventListTableEventTitleEditLink($event_title));
49
+	}
50 50
 
51 51
 
52
-    /**
53
-     * Navigates the user to the single event page (frontend view) for the given event title via clicking the "View" link
54
-     * for the event in the event list table.
55
-     *
56
-     * Assumes the actor is already logged in and on the Event list table page.
57
-     * @param string $event_title
58
-     */
59
-    public function amOnEventPageAfterClickingViewLinkInListTableForEvent($event_title)
60
-    {
61
-        $this->actor()->moveMouseOver(EventsPage::eventListTableEventTitleEditLinkSelectorForTitle($event_title));
62
-        $this->actor()->click(EventsPage::eventListTableEventTitleViewLinkSelectorForTitle($event_title));
63
-    }
52
+	/**
53
+	 * Navigates the user to the single event page (frontend view) for the given event title via clicking the "View" link
54
+	 * for the event in the event list table.
55
+	 *
56
+	 * Assumes the actor is already logged in and on the Event list table page.
57
+	 * @param string $event_title
58
+	 */
59
+	public function amOnEventPageAfterClickingViewLinkInListTableForEvent($event_title)
60
+	{
61
+		$this->actor()->moveMouseOver(EventsPage::eventListTableEventTitleEditLinkSelectorForTitle($event_title));
62
+		$this->actor()->click(EventsPage::eventListTableEventTitleViewLinkSelectorForTitle($event_title));
63
+	}
64 64
 }
65 65
\ No newline at end of file
Please login to merge, or discard this patch.
acceptance_tests/Helpers/MessagesAdmin.php 1 patch
Indentation   +82 added lines, -82 removed lines patch added patch discarded remove patch
@@ -10,96 +10,96 @@
 block discarded – undo
10 10
  */
11 11
 trait MessagesAdmin
12 12
 {
13
-    /**
14
-     * @param string $additional_params Any additional request parameters for the generated url should be included as
15
-     *                                  a string.
16
-     */
17
-    public function amOnMessagesActivityListTablePage($additional_params = '')
18
-    {
19
-        $this->actor()->amOnAdminPage(MessagesPage::messageActivityListTableUrl($additional_params));
20
-    }
13
+	/**
14
+	 * @param string $additional_params Any additional request parameters for the generated url should be included as
15
+	 *                                  a string.
16
+	 */
17
+	public function amOnMessagesActivityListTablePage($additional_params = '')
18
+	{
19
+		$this->actor()->amOnAdminPage(MessagesPage::messageActivityListTableUrl($additional_params));
20
+	}
21 21
 
22
-    /**
23
-     * @param string $additional_params Any additional request parameters for the generated url should be included as
24
-     *                                  a string.
25
-     */
26
-    public function amOnDefaultMessageTemplateListTablePage($additional_params = '')
27
-    {
28
-        $this->actor()->amOnAdminPage(MessagesPage::defaultMessageTemplateListTableUrl($additional_params));
29
-    }
22
+	/**
23
+	 * @param string $additional_params Any additional request parameters for the generated url should be included as
24
+	 *                                  a string.
25
+	 */
26
+	public function amOnDefaultMessageTemplateListTablePage($additional_params = '')
27
+	{
28
+		$this->actor()->amOnAdminPage(MessagesPage::defaultMessageTemplateListTableUrl($additional_params));
29
+	}
30 30
 
31 31
 
32
-    /**
33
-     * @param string $additional_params Any additional request parameters for the generated url should be included as
34
-     *                                  a string.
35
-     */
36
-    public function amOnCustomMessageTemplateListTablePage($additional_params = '')
37
-    {
38
-        $this->actor()->amOnAdminPage(MessagesPage::customMessageTemplateListTableUrl($additional_params));
39
-    }
32
+	/**
33
+	 * @param string $additional_params Any additional request parameters for the generated url should be included as
34
+	 *                                  a string.
35
+	 */
36
+	public function amOnCustomMessageTemplateListTablePage($additional_params = '')
37
+	{
38
+		$this->actor()->amOnAdminPage(MessagesPage::customMessageTemplateListTableUrl($additional_params));
39
+	}
40 40
 
41 41
 
42
-    /**
43
-     * Directs to message settings page
44
-     */
45
-    public function amOnMessageSettingsPage()
46
-    {
47
-        $this->actor()->amOnAdminPage(MessagesPage::messageSettingsUrl());
48
-    }
42
+	/**
43
+	 * Directs to message settings page
44
+	 */
45
+	public function amOnMessageSettingsPage()
46
+	{
47
+		$this->actor()->amOnAdminPage(MessagesPage::messageSettingsUrl());
48
+	}
49 49
 
50 50
 
51
-    /**
52
-     * Assumes you are already on the list table page that has the ui for editing the template.
53
-     * @param string $message_type_slug
54
-     * @param string $context [optional] if you want to click directly to the given context in the editor
55
-     */
56
-    public function clickToEditMessageTemplateByMessageType($message_type_slug, $context = '')
57
-    {
58
-        $this->actor()->click(MessagesPage::editMessageTemplateClassByMessageType($message_type_slug, $context));
59
-    }
51
+	/**
52
+	 * Assumes you are already on the list table page that has the ui for editing the template.
53
+	 * @param string $message_type_slug
54
+	 * @param string $context [optional] if you want to click directly to the given context in the editor
55
+	 */
56
+	public function clickToEditMessageTemplateByMessageType($message_type_slug, $context = '')
57
+	{
58
+		$this->actor()->click(MessagesPage::editMessageTemplateClassByMessageType($message_type_slug, $context));
59
+	}
60 60
 
61 61
 
62
-    /**
63
-     * Use this action to verify that the count for the given text in the specified field is as expected.  For example
64
-     * filling the condition of, "There should only be 1 instance of `[email protected]` in all the 'to' column.
65
-     *
66
-     * @param int    $expected_occurence_count
67
-     * @param string $text_to_check_for
68
-     * @param string $field
69
-     * @param string $message_type_label
70
-     * @param string $message_status
71
-     * @param string $messenger
72
-     * @param string $context
73
-     */
74
-    public function verifyMatchingCountofTextInMessageActivityListTableFor(
75
-        $expected_occurence_count,
76
-        $text_to_check_for,
77
-        $field,
78
-        $message_type_label,
79
-        $message_status = MessagesPage::MESSAGE_STATUS_SENT,
80
-        $messenger = 'Email',
81
-        $context = 'Event Admin'
82
-    ) {
83
-        $elements = $this->actor()->grabMultiple(MessagesPage::messagesActivityListTableCellSelectorFor(
84
-            $field,
85
-            $message_type_label,
86
-            $message_status,
87
-            $messenger,
88
-            $context,
89
-            $text_to_check_for
90
-        ));
91
-        $actual_count = count($elements);
92
-        $this->actor()->assertEquals(
93
-            $expected_occurence_count,
94
-            $actual_count,
95
-            sprintf(
96
-                'Expected %s of the %s text for the %s field but there were actually %s counted.',
97
-                $expected_occurence_count,
98
-                $text_to_check_for,
99
-                $field,
100
-                $actual_count
101
-            )
102
-        );
103
-    }
62
+	/**
63
+	 * Use this action to verify that the count for the given text in the specified field is as expected.  For example
64
+	 * filling the condition of, "There should only be 1 instance of `[email protected]` in all the 'to' column.
65
+	 *
66
+	 * @param int    $expected_occurence_count
67
+	 * @param string $text_to_check_for
68
+	 * @param string $field
69
+	 * @param string $message_type_label
70
+	 * @param string $message_status
71
+	 * @param string $messenger
72
+	 * @param string $context
73
+	 */
74
+	public function verifyMatchingCountofTextInMessageActivityListTableFor(
75
+		$expected_occurence_count,
76
+		$text_to_check_for,
77
+		$field,
78
+		$message_type_label,
79
+		$message_status = MessagesPage::MESSAGE_STATUS_SENT,
80
+		$messenger = 'Email',
81
+		$context = 'Event Admin'
82
+	) {
83
+		$elements = $this->actor()->grabMultiple(MessagesPage::messagesActivityListTableCellSelectorFor(
84
+			$field,
85
+			$message_type_label,
86
+			$message_status,
87
+			$messenger,
88
+			$context,
89
+			$text_to_check_for
90
+		));
91
+		$actual_count = count($elements);
92
+		$this->actor()->assertEquals(
93
+			$expected_occurence_count,
94
+			$actual_count,
95
+			sprintf(
96
+				'Expected %s of the %s text for the %s field but there were actually %s counted.',
97
+				$expected_occurence_count,
98
+				$text_to_check_for,
99
+				$field,
100
+				$actual_count
101
+			)
102
+		);
103
+	}
104 104
 
105 105
 }
106 106
\ No newline at end of file
Please login to merge, or discard this patch.
acceptance_tests/Page/EventsAdmin.php 1 patch
Indentation   +132 added lines, -132 removed lines patch added patch discarded remove patch
@@ -14,136 +14,136 @@
 block discarded – undo
14 14
 class EventsAdmin extends CoreAdmin
15 15
 {
16 16
 
17
-    /**
18
-     * Selector for the Add new Event button in the admin.
19
-     * @var string
20
-     */
21
-    const ADD_NEW_EVENT_BUTTON_SELECTOR = '#add-new-event';
22
-
23
-
24
-    /**
25
-     * Selector for the Event Title field in the event editor
26
-     * @var string
27
-     */
28
-    const EVENT_EDITOR_TITLE_FIELD_SELECTOR = "//input[@id='title']";
29
-
30
-    /**
31
-     * Selector for the publish submit button in the event editor.
32
-     * @var string
33
-     */
34
-    const EVENT_EDITOR_PUBLISH_BUTTON_SELECTOR = "#publish";
35
-
36
-    /**
37
-     * Selector for the view link after publishing an event.
38
-     * @var string
39
-     */
40
-    const EVENT_EDITOR_VIEW_LINK_AFTER_PUBLISH_SELECTOR = "//div[@id='message']/p/a";
41
-
42
-
43
-    /**
44
-     * Selector for the ID of the event in the event editor
45
-     * @var string
46
-     */
47
-    const EVENT_EDITOR_EVT_ID_SELECTOR = "//input[@id='post_ID']";
48
-
49
-
50
-    /**
51
-     * Selector for the search input on the event list table page.
52
-     * @var string
53
-     */
54
-    const EVENT_LIST_TABLE_SEARCH_INPUT_SELECTOR = '#toplevel_page_espresso_events-search-input';
55
-
56
-
57
-
58
-    /**
59
-     * @param string $additional_params
60
-     * @return string
61
-     */
62
-    public static function defaultEventsListTableUrl($additional_params = '')
63
-    {
64
-        return self::adminUrl('espresso_events', 'default', $additional_params);
65
-    }
66
-
67
-
68
-    /**
69
-     * The selector for the DTTname field for the given row in the event editor.
70
-     * @param int $row_number
71
-     * @return string
72
-     */
73
-    public static function eventEditorDatetimeNameFieldSelector($row_number = 1)
74
-    {
75
-        return self::eventEditorDatetimeFieldSelectorForField('DTT_name', $row_number);
76
-    }
77
-
78
-
79
-    /**
80
-     * The selector for the DTT_EVT_start field for the given row in the event editor.d
81
-     * @param int $row_number
82
-     * @return string
83
-     */
84
-    public static function eventEditorDatetimeStartDateFieldSelector($row_number = 1)
85
-    {
86
-        return self::eventEditorDatetimeFieldSelectorForField('DTT_EVT_start', $row_number);
87
-    }
88
-
89
-
90
-    /**
91
-     * Wrapper for getting the selector for a given field and given row of a datetime in the event editor.
92
-     *
93
-     * @param string $field_name
94
-     * @param int    $row_number
95
-     * @return string
96
-     */
97
-    public static function eventEditorDatetimeFieldSelectorForField($field_name, $row_number = 1)
98
-    {
99
-        return "//input[@id='event-datetime-$field_name-$row_number']";
100
-    }
101
-
102
-
103
-    /**
104
-     * The selector for the TKT_name field for the given display row in the event editor.
105
-     * @param int $row_number
106
-     * @return string
107
-     */
108
-    public static function eventEditorTicketNameFieldSelector($row_number = 1)
109
-    {
110
-        return self::eventEditorTicketFieldSelectorForFieldInDisplayRow('TKT_name', $row_number);
111
-    }
112
-
113
-
114
-    /**
115
-     * Wrapper for getting the selector for a given field and given display row of a ticket in the event editor.
116
-     * @param     $field_name
117
-     * @param int $row_number
118
-     * @return string
119
-     */
120
-    public static function eventEditorTicketFieldSelectorForFieldInDisplayRow($field_name, $row_number = 1)
121
-    {
122
-        return "//tr[@id='display-ticketrow-$row_number']/td[2]/input[@class='edit-ticket-$field_name ee-large-text-inp']";
123
-    }
124
-
125
-
126
-    /**
127
-     * Returns the selector for the event title edit link in the events list table for the given Event Title.
128
-     * @param string $event_title
129
-     * @return string
130
-     */
131
-    public static function eventListTableEventTitleEditLinkSelectorForTitle($event_title)
132
-    {
133
-        return "//td[contains(@class, 'column-name')]/strong/a[text()='$event_title']";
134
-    }
135
-
136
-
137
-    public static function eventListTableEventIdSelectorForTitle($event_title)
138
-    {
139
-        return "//td[contains(@class, 'column-name')]/strong/a[text()='$event_title']"
140
-            . "//ancestor::tr/td[contains(@class, 'column-id')]/text()";
141
-    }
142
-
143
-
144
-    public static function eventListTableEventTitleViewLinkSelectorForTitle($event_title)
145
-    {
146
-        return "//td[contains(@class, 'column-name')]/strong/a[text()='$event_title']"
147
-            . "//ancestor::td//span[@class='view']/a";
148
-    }
17
+	/**
18
+	 * Selector for the Add new Event button in the admin.
19
+	 * @var string
20
+	 */
21
+	const ADD_NEW_EVENT_BUTTON_SELECTOR = '#add-new-event';
22
+
23
+
24
+	/**
25
+	 * Selector for the Event Title field in the event editor
26
+	 * @var string
27
+	 */
28
+	const EVENT_EDITOR_TITLE_FIELD_SELECTOR = "//input[@id='title']";
29
+
30
+	/**
31
+	 * Selector for the publish submit button in the event editor.
32
+	 * @var string
33
+	 */
34
+	const EVENT_EDITOR_PUBLISH_BUTTON_SELECTOR = "#publish";
35
+
36
+	/**
37
+	 * Selector for the view link after publishing an event.
38
+	 * @var string
39
+	 */
40
+	const EVENT_EDITOR_VIEW_LINK_AFTER_PUBLISH_SELECTOR = "//div[@id='message']/p/a";
41
+
42
+
43
+	/**
44
+	 * Selector for the ID of the event in the event editor
45
+	 * @var string
46
+	 */
47
+	const EVENT_EDITOR_EVT_ID_SELECTOR = "//input[@id='post_ID']";
48
+
49
+
50
+	/**
51
+	 * Selector for the search input on the event list table page.
52
+	 * @var string
53
+	 */
54
+	const EVENT_LIST_TABLE_SEARCH_INPUT_SELECTOR = '#toplevel_page_espresso_events-search-input';
55
+
56
+
57
+
58
+	/**
59
+	 * @param string $additional_params
60
+	 * @return string
61
+	 */
62
+	public static function defaultEventsListTableUrl($additional_params = '')
63
+	{
64
+		return self::adminUrl('espresso_events', 'default', $additional_params);
65
+	}
66
+
67
+
68
+	/**
69
+	 * The selector for the DTTname field for the given row in the event editor.
70
+	 * @param int $row_number
71
+	 * @return string
72
+	 */
73
+	public static function eventEditorDatetimeNameFieldSelector($row_number = 1)
74
+	{
75
+		return self::eventEditorDatetimeFieldSelectorForField('DTT_name', $row_number);
76
+	}
77
+
78
+
79
+	/**
80
+	 * The selector for the DTT_EVT_start field for the given row in the event editor.d
81
+	 * @param int $row_number
82
+	 * @return string
83
+	 */
84
+	public static function eventEditorDatetimeStartDateFieldSelector($row_number = 1)
85
+	{
86
+		return self::eventEditorDatetimeFieldSelectorForField('DTT_EVT_start', $row_number);
87
+	}
88
+
89
+
90
+	/**
91
+	 * Wrapper for getting the selector for a given field and given row of a datetime in the event editor.
92
+	 *
93
+	 * @param string $field_name
94
+	 * @param int    $row_number
95
+	 * @return string
96
+	 */
97
+	public static function eventEditorDatetimeFieldSelectorForField($field_name, $row_number = 1)
98
+	{
99
+		return "//input[@id='event-datetime-$field_name-$row_number']";
100
+	}
101
+
102
+
103
+	/**
104
+	 * The selector for the TKT_name field for the given display row in the event editor.
105
+	 * @param int $row_number
106
+	 * @return string
107
+	 */
108
+	public static function eventEditorTicketNameFieldSelector($row_number = 1)
109
+	{
110
+		return self::eventEditorTicketFieldSelectorForFieldInDisplayRow('TKT_name', $row_number);
111
+	}
112
+
113
+
114
+	/**
115
+	 * Wrapper for getting the selector for a given field and given display row of a ticket in the event editor.
116
+	 * @param     $field_name
117
+	 * @param int $row_number
118
+	 * @return string
119
+	 */
120
+	public static function eventEditorTicketFieldSelectorForFieldInDisplayRow($field_name, $row_number = 1)
121
+	{
122
+		return "//tr[@id='display-ticketrow-$row_number']/td[2]/input[@class='edit-ticket-$field_name ee-large-text-inp']";
123
+	}
124
+
125
+
126
+	/**
127
+	 * Returns the selector for the event title edit link in the events list table for the given Event Title.
128
+	 * @param string $event_title
129
+	 * @return string
130
+	 */
131
+	public static function eventListTableEventTitleEditLinkSelectorForTitle($event_title)
132
+	{
133
+		return "//td[contains(@class, 'column-name')]/strong/a[text()='$event_title']";
134
+	}
135
+
136
+
137
+	public static function eventListTableEventIdSelectorForTitle($event_title)
138
+	{
139
+		return "//td[contains(@class, 'column-name')]/strong/a[text()='$event_title']"
140
+			. "//ancestor::tr/td[contains(@class, 'column-id')]/text()";
141
+	}
142
+
143
+
144
+	public static function eventListTableEventTitleViewLinkSelectorForTitle($event_title)
145
+	{
146
+		return "//td[contains(@class, 'column-name')]/strong/a[text()='$event_title']"
147
+			. "//ancestor::td//span[@class='view']/a";
148
+	}
149 149
 }
150 150
\ No newline at end of file
Please login to merge, or discard this patch.
espresso.php 1 patch
Indentation   +219 added lines, -219 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php if ( ! defined('ABSPATH')) {
2
-    exit('No direct script access allowed');
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 /*
5 5
   Plugin Name:		Event Espresso
@@ -40,243 +40,243 @@  discard block
 block discarded – undo
40 40
  * @since            4.0
41 41
  */
42 42
 if (function_exists('espresso_version')) {
43
-    /**
44
-     *    espresso_duplicate_plugin_error
45
-     *    displays if more than one version of EE is activated at the same time
46
-     */
47
-    function espresso_duplicate_plugin_error()
48
-    {
49
-        ?>
43
+	/**
44
+	 *    espresso_duplicate_plugin_error
45
+	 *    displays if more than one version of EE is activated at the same time
46
+	 */
47
+	function espresso_duplicate_plugin_error()
48
+	{
49
+		?>
50 50
         <div class="error">
51 51
             <p>
52 52
                 <?php echo esc_html__(
53
-                        'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.',
54
-                        'event_espresso'
55
-                ); ?>
53
+						'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.',
54
+						'event_espresso'
55
+				); ?>
56 56
             </p>
57 57
         </div>
58 58
         <?php
59
-        espresso_deactivate_plugin(plugin_basename(__FILE__));
60
-    }
59
+		espresso_deactivate_plugin(plugin_basename(__FILE__));
60
+	}
61 61
 
62
-    add_action('admin_notices', 'espresso_duplicate_plugin_error', 1);
62
+	add_action('admin_notices', 'espresso_duplicate_plugin_error', 1);
63 63
 } else {
64
-    define('EE_MIN_PHP_VER_REQUIRED', '5.3.9');
65
-    if ( ! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) {
66
-        /**
67
-         * espresso_minimum_php_version_error
68
-         *
69
-         * @return void
70
-         */
71
-        function espresso_minimum_php_version_error()
72
-        {
73
-            ?>
64
+	define('EE_MIN_PHP_VER_REQUIRED', '5.3.9');
65
+	if ( ! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) {
66
+		/**
67
+		 * espresso_minimum_php_version_error
68
+		 *
69
+		 * @return void
70
+		 */
71
+		function espresso_minimum_php_version_error()
72
+		{
73
+			?>
74 74
             <div class="error">
75 75
                 <p>
76 76
                     <?php
77
-                    printf(
78
-                            esc_html__(
79
-                                    'We\'re sorry, but Event Espresso requires PHP version %1$s or greater in order to operate. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.',
80
-                                    'event_espresso'
81
-                            ),
82
-                            EE_MIN_PHP_VER_REQUIRED,
83
-                            PHP_VERSION,
84
-                            '<br/>',
85
-                            '<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>'
86
-                    );
87
-                    ?>
77
+					printf(
78
+							esc_html__(
79
+									'We\'re sorry, but Event Espresso requires PHP version %1$s or greater in order to operate. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.',
80
+									'event_espresso'
81
+							),
82
+							EE_MIN_PHP_VER_REQUIRED,
83
+							PHP_VERSION,
84
+							'<br/>',
85
+							'<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>'
86
+					);
87
+					?>
88 88
                 </p>
89 89
             </div>
90 90
             <?php
91
-            espresso_deactivate_plugin(plugin_basename(__FILE__));
92
-        }
91
+			espresso_deactivate_plugin(plugin_basename(__FILE__));
92
+		}
93 93
 
94
-        add_action('admin_notices', 'espresso_minimum_php_version_error', 1);
95
-    } else {
96
-        /**
97
-         * espresso_version
98
-         * Returns the plugin version
99
-         *
100
-         * @return string
101
-         */
102
-        function espresso_version()
103
-        {
104
-            return apply_filters('FHEE__espresso__espresso_version', '4.9.39.rc.041');
105
-        }
94
+		add_action('admin_notices', 'espresso_minimum_php_version_error', 1);
95
+	} else {
96
+		/**
97
+		 * espresso_version
98
+		 * Returns the plugin version
99
+		 *
100
+		 * @return string
101
+		 */
102
+		function espresso_version()
103
+		{
104
+			return apply_filters('FHEE__espresso__espresso_version', '4.9.39.rc.041');
105
+		}
106 106
 
107
-        // define versions
108
-        define('EVENT_ESPRESSO_VERSION', espresso_version());
109
-        define('EE_MIN_WP_VER_REQUIRED', '4.1');
110
-        define('EE_MIN_WP_VER_RECOMMENDED', '4.4.2');
111
-        define('EE_MIN_PHP_VER_RECOMMENDED', '5.4.44');
112
-        define('EVENT_ESPRESSO_MAIN_FILE', __FILE__);
113
-        //used to be DIRECTORY_SEPARATOR, but that caused issues on windows
114
-        if ( ! defined('DS')) {
115
-            define('DS', '/');
116
-        }
117
-        if ( ! defined('PS')) {
118
-            define('PS', PATH_SEPARATOR);
119
-        }
120
-        if ( ! defined('SP')) {
121
-            define('SP', ' ');
122
-        }
123
-        if ( ! defined('EENL')) {
124
-            define('EENL', "\n");
125
-        }
126
-        define('EE_SUPPORT_EMAIL', '[email protected]');
127
-        // define the plugin directory and URL
128
-        define('EE_PLUGIN_BASENAME', plugin_basename(EVENT_ESPRESSO_MAIN_FILE));
129
-        define('EE_PLUGIN_DIR_PATH', plugin_dir_path(EVENT_ESPRESSO_MAIN_FILE));
130
-        define('EE_PLUGIN_DIR_URL', plugin_dir_url(EVENT_ESPRESSO_MAIN_FILE));
131
-        // main root folder paths
132
-        define('EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH . 'admin_pages' . DS);
133
-        define('EE_CORE', EE_PLUGIN_DIR_PATH . 'core' . DS);
134
-        define('EE_MODULES', EE_PLUGIN_DIR_PATH . 'modules' . DS);
135
-        define('EE_PUBLIC', EE_PLUGIN_DIR_PATH . 'public' . DS);
136
-        define('EE_SHORTCODES', EE_PLUGIN_DIR_PATH . 'shortcodes' . DS);
137
-        define('EE_WIDGETS', EE_PLUGIN_DIR_PATH . 'widgets' . DS);
138
-        define('EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH . 'payment_methods' . DS);
139
-        define('EE_CAFF_PATH', EE_PLUGIN_DIR_PATH . 'caffeinated' . DS);
140
-        // core system paths
141
-        define('EE_ADMIN', EE_CORE . 'admin' . DS);
142
-        define('EE_CPTS', EE_CORE . 'CPTs' . DS);
143
-        define('EE_CLASSES', EE_CORE . 'db_classes' . DS);
144
-        define('EE_INTERFACES', EE_CORE . 'interfaces' . DS);
145
-        define('EE_BUSINESS', EE_CORE . 'business' . DS);
146
-        define('EE_MODELS', EE_CORE . 'db_models' . DS);
147
-        define('EE_HELPERS', EE_CORE . 'helpers' . DS);
148
-        define('EE_LIBRARIES', EE_CORE . 'libraries' . DS);
149
-        define('EE_TEMPLATES', EE_CORE . 'templates' . DS);
150
-        define('EE_THIRD_PARTY', EE_CORE . 'third_party_libs' . DS);
151
-        define('EE_GLOBAL_ASSETS', EE_TEMPLATES . 'global_assets' . DS);
152
-        define('EE_FORM_SECTIONS', EE_LIBRARIES . 'form_sections' . DS);
153
-        // gateways
154
-        define('EE_GATEWAYS', EE_MODULES . 'gateways' . DS);
155
-        define('EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL . 'modules' . DS . 'gateways' . DS);
156
-        // asset URL paths
157
-        define('EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'templates' . DS);
158
-        define('EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL . 'global_assets' . DS);
159
-        define('EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL . 'images' . DS);
160
-        define('EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'third_party_libs' . DS);
161
-        define('EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL . 'core/helpers/assets/');
162
-        define('EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL . 'core/libraries/');
163
-        // define upload paths
164
-        $uploads = wp_upload_dir();
165
-        // define the uploads directory and URL
166
-        define('EVENT_ESPRESSO_UPLOAD_DIR', $uploads['basedir'] . DS . 'espresso' . DS);
167
-        define('EVENT_ESPRESSO_UPLOAD_URL', $uploads['baseurl'] . DS . 'espresso' . DS);
168
-        // define the templates directory and URL
169
-        define('EVENT_ESPRESSO_TEMPLATE_DIR', $uploads['basedir'] . DS . 'espresso' . DS . 'templates' . DS);
170
-        define('EVENT_ESPRESSO_TEMPLATE_URL', $uploads['baseurl'] . DS . 'espresso' . DS . 'templates' . DS);
171
-        // define the gateway directory and URL
172
-        define('EVENT_ESPRESSO_GATEWAY_DIR', $uploads['basedir'] . DS . 'espresso' . DS . 'gateways' . DS);
173
-        define('EVENT_ESPRESSO_GATEWAY_URL', $uploads['baseurl'] . DS . 'espresso' . DS . 'gateways' . DS);
174
-        // languages folder/path
175
-        define('EE_LANGUAGES_SAFE_LOC', '..' . DS . 'uploads' . DS . 'espresso' . DS . 'languages' . DS);
176
-        define('EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'languages' . DS);
177
-        //check for dompdf fonts in uploads
178
-        if (file_exists(EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS)) {
179
-            define('DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS);
180
-        }
181
-        //ajax constants
182
-        define(
183
-                'EE_FRONT_AJAX',
184
-                isset($_REQUEST['ee_front_ajax']) || isset($_REQUEST['data']['ee_front_ajax']) ? true : false
185
-        );
186
-        define(
187
-                'EE_ADMIN_AJAX',
188
-                isset($_REQUEST['ee_admin_ajax']) || isset($_REQUEST['data']['ee_admin_ajax']) ? true : false
189
-        );
190
-        //just a handy constant occasionally needed for finding values representing infinity in the DB
191
-        //you're better to use this than its straight value (currently -1) in case you ever
192
-        //want to change its default value! or find when -1 means infinity
193
-        define('EE_INF_IN_DB', -1);
194
-        define('EE_INF', INF > (float)PHP_INT_MAX ? INF : PHP_INT_MAX);
195
-        define('EE_DEBUG', false);
196
-        // for older WP versions
197
-        if ( ! defined('MONTH_IN_SECONDS')) {
198
-            define('MONTH_IN_SECONDS', DAY_IN_SECONDS * 30);
199
-        }
200
-        /**
201
-         *    espresso_plugin_activation
202
-         *    adds a wp-option to indicate that EE has been activated via the WP admin plugins page
203
-         */
204
-        function espresso_plugin_activation()
205
-        {
206
-            update_option('ee_espresso_activation', true);
207
-        }
107
+		// define versions
108
+		define('EVENT_ESPRESSO_VERSION', espresso_version());
109
+		define('EE_MIN_WP_VER_REQUIRED', '4.1');
110
+		define('EE_MIN_WP_VER_RECOMMENDED', '4.4.2');
111
+		define('EE_MIN_PHP_VER_RECOMMENDED', '5.4.44');
112
+		define('EVENT_ESPRESSO_MAIN_FILE', __FILE__);
113
+		//used to be DIRECTORY_SEPARATOR, but that caused issues on windows
114
+		if ( ! defined('DS')) {
115
+			define('DS', '/');
116
+		}
117
+		if ( ! defined('PS')) {
118
+			define('PS', PATH_SEPARATOR);
119
+		}
120
+		if ( ! defined('SP')) {
121
+			define('SP', ' ');
122
+		}
123
+		if ( ! defined('EENL')) {
124
+			define('EENL', "\n");
125
+		}
126
+		define('EE_SUPPORT_EMAIL', '[email protected]');
127
+		// define the plugin directory and URL
128
+		define('EE_PLUGIN_BASENAME', plugin_basename(EVENT_ESPRESSO_MAIN_FILE));
129
+		define('EE_PLUGIN_DIR_PATH', plugin_dir_path(EVENT_ESPRESSO_MAIN_FILE));
130
+		define('EE_PLUGIN_DIR_URL', plugin_dir_url(EVENT_ESPRESSO_MAIN_FILE));
131
+		// main root folder paths
132
+		define('EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH . 'admin_pages' . DS);
133
+		define('EE_CORE', EE_PLUGIN_DIR_PATH . 'core' . DS);
134
+		define('EE_MODULES', EE_PLUGIN_DIR_PATH . 'modules' . DS);
135
+		define('EE_PUBLIC', EE_PLUGIN_DIR_PATH . 'public' . DS);
136
+		define('EE_SHORTCODES', EE_PLUGIN_DIR_PATH . 'shortcodes' . DS);
137
+		define('EE_WIDGETS', EE_PLUGIN_DIR_PATH . 'widgets' . DS);
138
+		define('EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH . 'payment_methods' . DS);
139
+		define('EE_CAFF_PATH', EE_PLUGIN_DIR_PATH . 'caffeinated' . DS);
140
+		// core system paths
141
+		define('EE_ADMIN', EE_CORE . 'admin' . DS);
142
+		define('EE_CPTS', EE_CORE . 'CPTs' . DS);
143
+		define('EE_CLASSES', EE_CORE . 'db_classes' . DS);
144
+		define('EE_INTERFACES', EE_CORE . 'interfaces' . DS);
145
+		define('EE_BUSINESS', EE_CORE . 'business' . DS);
146
+		define('EE_MODELS', EE_CORE . 'db_models' . DS);
147
+		define('EE_HELPERS', EE_CORE . 'helpers' . DS);
148
+		define('EE_LIBRARIES', EE_CORE . 'libraries' . DS);
149
+		define('EE_TEMPLATES', EE_CORE . 'templates' . DS);
150
+		define('EE_THIRD_PARTY', EE_CORE . 'third_party_libs' . DS);
151
+		define('EE_GLOBAL_ASSETS', EE_TEMPLATES . 'global_assets' . DS);
152
+		define('EE_FORM_SECTIONS', EE_LIBRARIES . 'form_sections' . DS);
153
+		// gateways
154
+		define('EE_GATEWAYS', EE_MODULES . 'gateways' . DS);
155
+		define('EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL . 'modules' . DS . 'gateways' . DS);
156
+		// asset URL paths
157
+		define('EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'templates' . DS);
158
+		define('EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL . 'global_assets' . DS);
159
+		define('EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL . 'images' . DS);
160
+		define('EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'third_party_libs' . DS);
161
+		define('EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL . 'core/helpers/assets/');
162
+		define('EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL . 'core/libraries/');
163
+		// define upload paths
164
+		$uploads = wp_upload_dir();
165
+		// define the uploads directory and URL
166
+		define('EVENT_ESPRESSO_UPLOAD_DIR', $uploads['basedir'] . DS . 'espresso' . DS);
167
+		define('EVENT_ESPRESSO_UPLOAD_URL', $uploads['baseurl'] . DS . 'espresso' . DS);
168
+		// define the templates directory and URL
169
+		define('EVENT_ESPRESSO_TEMPLATE_DIR', $uploads['basedir'] . DS . 'espresso' . DS . 'templates' . DS);
170
+		define('EVENT_ESPRESSO_TEMPLATE_URL', $uploads['baseurl'] . DS . 'espresso' . DS . 'templates' . DS);
171
+		// define the gateway directory and URL
172
+		define('EVENT_ESPRESSO_GATEWAY_DIR', $uploads['basedir'] . DS . 'espresso' . DS . 'gateways' . DS);
173
+		define('EVENT_ESPRESSO_GATEWAY_URL', $uploads['baseurl'] . DS . 'espresso' . DS . 'gateways' . DS);
174
+		// languages folder/path
175
+		define('EE_LANGUAGES_SAFE_LOC', '..' . DS . 'uploads' . DS . 'espresso' . DS . 'languages' . DS);
176
+		define('EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'languages' . DS);
177
+		//check for dompdf fonts in uploads
178
+		if (file_exists(EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS)) {
179
+			define('DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS);
180
+		}
181
+		//ajax constants
182
+		define(
183
+				'EE_FRONT_AJAX',
184
+				isset($_REQUEST['ee_front_ajax']) || isset($_REQUEST['data']['ee_front_ajax']) ? true : false
185
+		);
186
+		define(
187
+				'EE_ADMIN_AJAX',
188
+				isset($_REQUEST['ee_admin_ajax']) || isset($_REQUEST['data']['ee_admin_ajax']) ? true : false
189
+		);
190
+		//just a handy constant occasionally needed for finding values representing infinity in the DB
191
+		//you're better to use this than its straight value (currently -1) in case you ever
192
+		//want to change its default value! or find when -1 means infinity
193
+		define('EE_INF_IN_DB', -1);
194
+		define('EE_INF', INF > (float)PHP_INT_MAX ? INF : PHP_INT_MAX);
195
+		define('EE_DEBUG', false);
196
+		// for older WP versions
197
+		if ( ! defined('MONTH_IN_SECONDS')) {
198
+			define('MONTH_IN_SECONDS', DAY_IN_SECONDS * 30);
199
+		}
200
+		/**
201
+		 *    espresso_plugin_activation
202
+		 *    adds a wp-option to indicate that EE has been activated via the WP admin plugins page
203
+		 */
204
+		function espresso_plugin_activation()
205
+		{
206
+			update_option('ee_espresso_activation', true);
207
+		}
208 208
 
209
-        register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation');
210
-        /**
211
-         *    espresso_load_error_handling
212
-         *    this function loads EE's class for handling exceptions and errors
213
-         */
214
-        function espresso_load_error_handling()
215
-        {
216
-            // load debugging tools
217
-            if (WP_DEBUG === true && is_readable(EE_HELPERS . 'EEH_Debug_Tools.helper.php')) {
218
-                require_once(EE_HELPERS . 'EEH_Debug_Tools.helper.php');
219
-                EEH_Debug_Tools::instance();
220
-            }
221
-            // load error handling
222
-            if (is_readable(EE_CORE . 'EE_Error.core.php')) {
223
-                require_once(EE_CORE . 'EE_Error.core.php');
224
-            } else {
225
-                wp_die(esc_html__('The EE_Error core class could not be loaded.', 'event_espresso'));
226
-            }
227
-        }
209
+		register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation');
210
+		/**
211
+		 *    espresso_load_error_handling
212
+		 *    this function loads EE's class for handling exceptions and errors
213
+		 */
214
+		function espresso_load_error_handling()
215
+		{
216
+			// load debugging tools
217
+			if (WP_DEBUG === true && is_readable(EE_HELPERS . 'EEH_Debug_Tools.helper.php')) {
218
+				require_once(EE_HELPERS . 'EEH_Debug_Tools.helper.php');
219
+				EEH_Debug_Tools::instance();
220
+			}
221
+			// load error handling
222
+			if (is_readable(EE_CORE . 'EE_Error.core.php')) {
223
+				require_once(EE_CORE . 'EE_Error.core.php');
224
+			} else {
225
+				wp_die(esc_html__('The EE_Error core class could not be loaded.', 'event_espresso'));
226
+			}
227
+		}
228 228
 
229
-        /**
230
-         *    espresso_load_required
231
-         *    given a class name and path, this function will load that file or throw an exception
232
-         *
233
-         * @param    string $classname
234
-         * @param    string $full_path_to_file
235
-         * @throws    EE_Error
236
-         */
237
-        function espresso_load_required($classname, $full_path_to_file)
238
-        {
239
-            static $error_handling_loaded = false;
240
-            if ( ! $error_handling_loaded) {
241
-                espresso_load_error_handling();
242
-                $error_handling_loaded = true;
243
-            }
244
-            if (is_readable($full_path_to_file)) {
245
-                require_once($full_path_to_file);
246
-            } else {
247
-                throw new EE_Error (
248
-                        sprintf(
249
-                                esc_html__(
250
-                                        'The %s class file could not be located or is not readable due to file permissions.',
251
-                                        'event_espresso'
252
-                                ),
253
-                                $classname
254
-                        )
255
-                );
256
-            }
257
-        }
229
+		/**
230
+		 *    espresso_load_required
231
+		 *    given a class name and path, this function will load that file or throw an exception
232
+		 *
233
+		 * @param    string $classname
234
+		 * @param    string $full_path_to_file
235
+		 * @throws    EE_Error
236
+		 */
237
+		function espresso_load_required($classname, $full_path_to_file)
238
+		{
239
+			static $error_handling_loaded = false;
240
+			if ( ! $error_handling_loaded) {
241
+				espresso_load_error_handling();
242
+				$error_handling_loaded = true;
243
+			}
244
+			if (is_readable($full_path_to_file)) {
245
+				require_once($full_path_to_file);
246
+			} else {
247
+				throw new EE_Error (
248
+						sprintf(
249
+								esc_html__(
250
+										'The %s class file could not be located or is not readable due to file permissions.',
251
+										'event_espresso'
252
+								),
253
+								$classname
254
+						)
255
+				);
256
+			}
257
+		}
258 258
 
259
-        espresso_load_required('EEH_Base', EE_CORE . 'helpers' . DS . 'EEH_Base.helper.php');
260
-        espresso_load_required('EEH_File', EE_CORE . 'helpers' . DS . 'EEH_File.helper.php');
261
-        espresso_load_required('EE_Bootstrap', EE_CORE . 'EE_Bootstrap.core.php');
262
-        new EE_Bootstrap();
263
-    }
259
+		espresso_load_required('EEH_Base', EE_CORE . 'helpers' . DS . 'EEH_Base.helper.php');
260
+		espresso_load_required('EEH_File', EE_CORE . 'helpers' . DS . 'EEH_File.helper.php');
261
+		espresso_load_required('EE_Bootstrap', EE_CORE . 'EE_Bootstrap.core.php');
262
+		new EE_Bootstrap();
263
+	}
264 264
 }
265 265
 if ( ! function_exists('espresso_deactivate_plugin')) {
266
-    /**
267
-     *    deactivate_plugin
268
-     * usage:  espresso_deactivate_plugin( plugin_basename( __FILE__ ));
269
-     *
270
-     * @access public
271
-     * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file
272
-     * @return    void
273
-     */
274
-    function espresso_deactivate_plugin($plugin_basename = '')
275
-    {
276
-        if ( ! function_exists('deactivate_plugins')) {
277
-            require_once(ABSPATH . 'wp-admin/includes/plugin.php');
278
-        }
279
-        unset($_GET['activate'], $_REQUEST['activate']);
280
-        deactivate_plugins($plugin_basename);
281
-    }
266
+	/**
267
+	 *    deactivate_plugin
268
+	 * usage:  espresso_deactivate_plugin( plugin_basename( __FILE__ ));
269
+	 *
270
+	 * @access public
271
+	 * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file
272
+	 * @return    void
273
+	 */
274
+	function espresso_deactivate_plugin($plugin_basename = '')
275
+	{
276
+		if ( ! function_exists('deactivate_plugins')) {
277
+			require_once(ABSPATH . 'wp-admin/includes/plugin.php');
278
+		}
279
+		unset($_GET['activate'], $_REQUEST['activate']);
280
+		deactivate_plugins($plugin_basename);
281
+	}
282 282
 }
283 283
\ No newline at end of file
Please login to merge, or discard this patch.