- Timestamp:
- 06/08/2017 08:18:20 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
r5549 r5558 59 59 60 60 /** 61 * Add a cachebusting parameter to bypass the object cache62 *63 * Cache keys are generated based on the function's input arguments (e.g., get_location()), so adding a unique64 * parameter on every function call ensures that the unit tests will never get a cached result.65 *66 * @param array $arguments67 *68 * @return array69 */70 function add_cachebusting_parameter( $arguments ) {71 $arguments['cachebuster'] = microtime( true );72 73 return $arguments;74 }75 76 /**77 61 * Test `get_location()` 78 62 * … … 86 70 87 71 foreach ( $cases as $case_id => $case ) { 88 $case['input'] = add_cachebusting_parameter( $case['input'] );89 72 $actual_result = get_location( $case['input'] ); 90 73 … … 860 843 } 861 844 845 /** 846 * Stub to simulate cache misses, so that the tests always get fresh results 847 * 848 * @return false 849 */ 850 function wp_cache_get() { 851 return false; 852 } 853 854 /** 855 * Stub to simulate cache misses, so that the tests always get fresh results 856 */ 857 function wp_cache_set() { 858 // Intentionally empty 859 } 860 862 861 run_tests();
Note: See TracChangeset
for help on using the changeset viewer.