From 0fbe425a3e74c1eedfb59a4cf3decaecae6a2cae Mon Sep 17 00:00:00 2001 From: Ian Dunn Date: Wed, 14 Oct 2020 18:20:40 +0000 Subject: [PATCH] Community Events: Apply coding standards. The previous commits intentionally didn't include these, because it would have added an unreasonable amount of diff noise. See #51130 git-svn-id: https://develop.svn.wordpress.org/trunk@49147 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/script-loader.php | 6 +- .../tests/admin/includesCommunityEvents.php | 273 +++++++++--------- 2 files changed, 141 insertions(+), 138 deletions(-) diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index e889d41a62..4a0417901d 100644 --- a/src/wp-includes/script-loader.php +++ b/src/wp-includes/script-loader.php @@ -1754,11 +1754,11 @@ function wp_localize_community_events() { 'dashboard', 'communityEventsData', array( - 'nonce' => wp_create_nonce( 'community_events' ), - 'cache' => $events_client->get_cached_events(), + 'nonce' => wp_create_nonce( 'community_events' ), + 'cache' => $events_client->get_cached_events(), 'time_format' => get_option( 'time_format' ), - 'l10n' => array( + 'l10n' => array( 'enter_closest_city' => __( 'Enter your closest city to find nearby events.' ), 'error_occurred_please_try_again' => __( 'An error occurred. Please try again.' ), 'attend_event_near_generic' => __( 'Attend an upcoming event near you.' ), diff --git a/tests/phpunit/tests/admin/includesCommunityEvents.php b/tests/phpunit/tests/admin/includesCommunityEvents.php index 2c1c4134b5..b0280dd92e 100644 --- a/tests/phpunit/tests/admin/includesCommunityEvents.php +++ b/tests/phpunit/tests/admin/includesCommunityEvents.php @@ -337,70 +337,73 @@ class Test_WP_Community_Events extends WP_UnitTestCase { */ public function _events_with_unpinned_wordcamp() { return array( - array( - 'type' => 'meetup', - 'title' => 'Flexbox + CSS Grid: Magic for Responsive Layouts', - 'url' => 'https://www.meetup.com/Eastbay-WordPress-Meetup/events/236031233/', - 'meetup' => 'The East Bay WordPress Meetup Group', - 'meetup_url' => 'https://www.meetup.com/Eastbay-WordPress-Meetup/', - 'start_unix_timestamp' => strtotime( 'next Monday 1pm' ), - 'end_unix_timestamp' => strtotime( 'next Monday 2pm' ), + array( + 'type' => 'meetup', + 'title' => 'Flexbox + CSS Grid: Magic for Responsive Layouts', + 'url' => 'https://www.meetup.com/Eastbay-WordPress-Meetup/events/236031233/', + 'meetup' => 'The East Bay WordPress Meetup Group', + 'meetup_url' => 'https://www.meetup.com/Eastbay-WordPress-Meetup/', + 'start_unix_timestamp' => strtotime( 'next Monday 1pm' ), + 'end_unix_timestamp' => strtotime( 'next Monday 2pm' ), - 'location' => array( - 'location' => 'Oakland, CA, USA', - 'country' => 'us', - 'latitude' => 37.808453, - 'longitude' => -122.26593, - ), - ), - array( - 'type' => 'meetup', - 'title' => 'Part 3- Site Maintenance - Tools to Make It Easy', - 'url' => 'https://www.meetup.com/Wordpress-Bay-Area-CA-Foothills/events/237706839/', - 'meetup' => 'WordPress Bay Area Foothills Group', - 'meetup_url' => 'https://www.meetup.com/Wordpress-Bay-Area-CA-Foothills/', - 'start_unix_timestamp' => strtotime( 'next Tuesday 1:30pm' ), - 'end_unix_timestamp' => strtotime( 'next Tuesday 2:30pm' ), + 'location' => array( + 'location' => 'Oakland, CA, USA', + 'country' => 'us', + 'latitude' => 37.808453, + 'longitude' => -122.26593, + ), + ), - 'location' => array( - 'location' => 'Milpitas, CA, USA', - 'country' => 'us', - 'latitude' => 37.432813, - 'longitude' => -121.907095, - ), - ), - array( - 'type' => 'meetup', - 'title' => 'WordPress Q&A', - 'url' => 'https://www.meetup.com/sanjosewp/events/245419844/', - 'meetup' => 'The San Jose WordPress Meetup', - 'meetup_url' => 'https://www.meetup.com/sanjosewp/', - 'start_unix_timestamp' => strtotime( 'next Wednesday 5:30pm' ), - 'end_unix_timestamp' => strtotime( 'next Wednesday 6:30pm' ), + array( + 'type' => 'meetup', + 'title' => 'Part 3- Site Maintenance - Tools to Make It Easy', + 'url' => 'https://www.meetup.com/Wordpress-Bay-Area-CA-Foothills/events/237706839/', + 'meetup' => 'WordPress Bay Area Foothills Group', + 'meetup_url' => 'https://www.meetup.com/Wordpress-Bay-Area-CA-Foothills/', + 'start_unix_timestamp' => strtotime( 'next Tuesday 1:30pm' ), + 'end_unix_timestamp' => strtotime( 'next Tuesday 2:30pm' ), - 'location' => array( - 'location' => 'Milpitas, CA, USA', - 'country' => 'us', - 'latitude' => 37.244194, - 'longitude' => -121.889313, - ), - ), - array( - 'type' => 'wordcamp', - 'title' => 'WordCamp San Diego', - 'url' => 'https://2018.sandiego.wordcamp.org', - 'meetup' => null, - 'meetup_url' => null, - 'start_unix_timestamp' => strtotime( 'next Thursday 9am' ), - 'end_unix_timestamp' => strtotime( 'next Thursday 10am' ), + 'location' => array( + 'location' => 'Milpitas, CA, USA', + 'country' => 'us', + 'latitude' => 37.432813, + 'longitude' => -121.907095, + ), + ), - 'location' => array( - 'location' => 'San Diego, CA', - 'country' => 'US', - 'latitude' => 32.7220419, - 'longitude' => -117.1534513, - ), - ), + array( + 'type' => 'meetup', + 'title' => 'WordPress Q&A', + 'url' => 'https://www.meetup.com/sanjosewp/events/245419844/', + 'meetup' => 'The San Jose WordPress Meetup', + 'meetup_url' => 'https://www.meetup.com/sanjosewp/', + 'start_unix_timestamp' => strtotime( 'next Wednesday 5:30pm' ), + 'end_unix_timestamp' => strtotime( 'next Wednesday 6:30pm' ), + + 'location' => array( + 'location' => 'Milpitas, CA, USA', + 'country' => 'us', + 'latitude' => 37.244194, + 'longitude' => -121.889313, + ), + ), + + array( + 'type' => 'wordcamp', + 'title' => 'WordCamp San Diego', + 'url' => 'https://2018.sandiego.wordcamp.org', + 'meetup' => null, + 'meetup_url' => null, + 'start_unix_timestamp' => strtotime( 'next Thursday 9am' ), + 'end_unix_timestamp' => strtotime( 'next Thursday 10am' ), + + 'location' => array( + 'location' => 'San Diego, CA', + 'country' => 'US', + 'latitude' => 32.7220419, + 'longitude' => -117.1534513, + ), + ), ); } @@ -440,90 +443,90 @@ class Test_WP_Community_Events extends WP_UnitTestCase { */ public function _events_with_multiple_wordcamps() { return array( - array( - 'type' => 'meetup', - 'title' => 'Flexbox + CSS Grid: Magic for Responsive Layouts', - 'url' => 'https://www.meetup.com/Eastbay-WordPress-Meetup/events/236031233/', - 'meetup' => 'The East Bay WordPress Meetup Group', - 'meetup_url' => 'https://www.meetup.com/Eastbay-WordPress-Meetup/', - 'start_unix_timestamp' => strtotime( '2 days ago' ) - HOUR_IN_SECONDS, - 'end_unix_timestamp' => strtotime( '2 days ago' ), + array( + 'type' => 'meetup', + 'title' => 'Flexbox + CSS Grid: Magic for Responsive Layouts', + 'url' => 'https://www.meetup.com/Eastbay-WordPress-Meetup/events/236031233/', + 'meetup' => 'The East Bay WordPress Meetup Group', + 'meetup_url' => 'https://www.meetup.com/Eastbay-WordPress-Meetup/', + 'start_unix_timestamp' => strtotime( '2 days ago' ) - HOUR_IN_SECONDS, + 'end_unix_timestamp' => strtotime( '2 days ago' ), - 'location' => array( - 'location' => 'Oakland, CA, USA', - 'country' => 'us', - 'latitude' => 37.808453, - 'longitude' => -122.26593, - ), - ), + 'location' => array( + 'location' => 'Oakland, CA, USA', + 'country' => 'us', + 'latitude' => 37.808453, + 'longitude' => -122.26593, + ), + ), - array( - 'type' => 'wordcamp', - 'title' => 'WordCamp San Diego', - 'url' => 'https://2018.sandiego.wordcamp.org', - 'meetup' => null, - 'meetup_url' => null, - 'start_unix_timestamp' => strtotime( 'next Tuesday 9am' ), - 'end_unix_timestamp' => strtotime( 'next Tuesday 10am' ), + array( + 'type' => 'wordcamp', + 'title' => 'WordCamp San Diego', + 'url' => 'https://2018.sandiego.wordcamp.org', + 'meetup' => null, + 'meetup_url' => null, + 'start_unix_timestamp' => strtotime( 'next Tuesday 9am' ), + 'end_unix_timestamp' => strtotime( 'next Tuesday 10am' ), - 'location' => array( - 'location' => 'San Diego, CA', - 'country' => 'US', - 'latitude' => 32.7220419, - 'longitude' => -117.1534513, - ), - ), + 'location' => array( + 'location' => 'San Diego, CA', + 'country' => 'US', + 'latitude' => 32.7220419, + 'longitude' => -117.1534513, + ), + ), - array( - 'type' => 'meetup', - 'title' => 'Part 3- Site Maintenance - Tools to Make It Easy', - 'url' => 'https://www.meetup.com/Wordpress-Bay-Area-CA-Foothills/events/237706839/', - 'meetup' => 'WordPress Bay Area Foothills Group', - 'meetup_url' => 'https://www.meetup.com/Wordpress-Bay-Area-CA-Foothills/', - 'start_unix_timestamp' => strtotime( 'next Wednesday 1:30pm' ), - 'end_unix_timestamp' => strtotime( 'next Wednesday 2:30pm' ), + array( + 'type' => 'meetup', + 'title' => 'Part 3- Site Maintenance - Tools to Make It Easy', + 'url' => 'https://www.meetup.com/Wordpress-Bay-Area-CA-Foothills/events/237706839/', + 'meetup' => 'WordPress Bay Area Foothills Group', + 'meetup_url' => 'https://www.meetup.com/Wordpress-Bay-Area-CA-Foothills/', + 'start_unix_timestamp' => strtotime( 'next Wednesday 1:30pm' ), + 'end_unix_timestamp' => strtotime( 'next Wednesday 2:30pm' ), - 'location' => array( - 'location' => 'Milpitas, CA, USA', - 'country' => 'us', - 'latitude' => 37.432813, - 'longitude' => -121.907095, - ), - ), + 'location' => array( + 'location' => 'Milpitas, CA, USA', + 'country' => 'us', + 'latitude' => 37.432813, + 'longitude' => -121.907095, + ), + ), - array( - 'type' => 'meetup', - 'title' => 'WordPress Q&A', - 'url' => 'https://www.meetup.com/sanjosewp/events/245419844/', - 'meetup' => 'The San Jose WordPress Meetup', - 'meetup_url' => 'https://www.meetup.com/sanjosewp/', - 'start_unix_timestamp' => strtotime( 'next Thursday 5:30pm' ), - 'end_unix_timestamp' => strtotime( 'next Thursday 6:30pm' ), + array( + 'type' => 'meetup', + 'title' => 'WordPress Q&A', + 'url' => 'https://www.meetup.com/sanjosewp/events/245419844/', + 'meetup' => 'The San Jose WordPress Meetup', + 'meetup_url' => 'https://www.meetup.com/sanjosewp/', + 'start_unix_timestamp' => strtotime( 'next Thursday 5:30pm' ), + 'end_unix_timestamp' => strtotime( 'next Thursday 6:30pm' ), - 'location' => array( - 'location' => 'Milpitas, CA, USA', - 'country' => 'us', - 'latitude' => 37.244194, - 'longitude' => -121.889313, - ), - ), + 'location' => array( + 'location' => 'Milpitas, CA, USA', + 'country' => 'us', + 'latitude' => 37.244194, + 'longitude' => -121.889313, + ), + ), - array( - 'type' => 'wordcamp', - 'title' => 'WordCamp Los Angeles', - 'url' => 'https://2018.la.wordcamp.org', - 'meetup' => null, - 'meetup_url' => null, - 'start_unix_timestamp' => strtotime( 'next Friday 9am' ), - 'end_unix_timestamp' => strtotime( 'next Friday 10am' ), + array( + 'type' => 'wordcamp', + 'title' => 'WordCamp Los Angeles', + 'url' => 'https://2018.la.wordcamp.org', + 'meetup' => null, + 'meetup_url' => null, + 'start_unix_timestamp' => strtotime( 'next Friday 9am' ), + 'end_unix_timestamp' => strtotime( 'next Friday 10am' ), - 'location' => array( - 'location' => 'Los Angeles, CA', - 'country' => 'US', - 'latitude' => 34.050888, - 'longitude' => -118.285426, - ), - ), + 'location' => array( + 'location' => 'Los Angeles, CA', + 'country' => 'US', + 'latitude' => 34.050888, + 'longitude' => -118.285426, + ), + ), ); }