- Timestamp:
- 03/09/2017 09:18:39 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/api.wordpress.org/public_html/events/1.0/tests/test-index.php
r5137 r5138 49 49 50 50 /** 51 * Add a cachebusting parameter to bypass the object cache 52 * 53 * Cache keys are generated based on the function's input arguments (e.g., get_location()), so adding a unique 54 * parameter on every function call ensures that the unit tests will never get a cached result. 55 * 56 * @param array $arguments 57 * 58 * @return array 59 */ 60 function add_cachebusting_parameter( $arguments ) { 61 $arguments['cachebuster'] = microtime( true ); 62 63 return $arguments; 64 } 65 66 /** 51 67 * Test `get_location()` 52 68 * … … 60 76 61 77 foreach ( $cases as $case_id => $case ) { 78 $case['input'] = add_cachebusting_parameter( $case['input'] ); 62 79 $actual_result = get_location( $case['input'] ); 63 80 … … 605 622 606 623 foreach ( $cases as $case_id => $case ) { 624 $case['input'] = add_cachebusting_parameter( $case['input'] ); 607 625 $actual_result = get_city_from_coordinates( $case['input']['latitude'], $case['input']['longitude'] ); 608 626 $passed = $case['expected'] === $actual_result;
Note: See TracChangeset
for help on using the changeset viewer.