Changeset 43555 for trunk/tests/phpunit/includes/functions.php
- Timestamp:
- 08/02/2018 10:35:10 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/functions.php
r42724 r43555 17 17 } 18 18 19 // For adding hooks before loading WP 19 /** 20 * Adds hooks before loading WP. 21 * 22 * @param string $tag The name for the filter to add. 23 * @param object|array $function_to_add The function/callback to execute on call. 24 * @param int $priority The priority. 25 * @param int $accepted_args The amount of accepted arguments. 26 * @return bool Always true. 27 */ 20 28 function tests_add_filter( $tag, $function_to_add, $priority = 10, $accepted_args = 1 ) { 21 29 global $wp_filter; … … 33 41 } 34 42 43 /** 44 * Generates a unique function ID based on the given arguments. 45 * 46 * @param string $tag Unused. The name of the filter to build ID for. 47 * @param object|array $function The function to generate ID for. 48 * @param int $priority Unused. The priority. 49 * @return string Unique function ID. 50 */ 35 51 function _test_filter_build_unique_id( $tag, $function, $priority ) { 36 52 if ( is_string( $function ) ) { … … 39 55 40 56 if ( is_object( $function ) ) { 41 // Closures are currently implemented as objects 57 // Closures are currently implemented as objects. 42 58 $function = array( $function, '' ); 43 59 } else { … … 48 64 return spl_object_hash( $function[0] ) . $function[1]; 49 65 } elseif ( is_string( $function[0] ) ) { 50 // Static Calling 66 // Static Calling. 51 67 return $function[0] . $function[1]; 52 68 } 53 69 } 54 70 71 /** 72 * Deletes all data from the database. 73 */ 55 74 function _delete_all_data() { 56 75 global $wpdb; … … 80 99 } 81 100 101 /** 102 * Deletes all posts from the database. 103 */ 82 104 function _delete_all_posts() { 83 105 global $wpdb;
Note: See TracChangeset
for help on using the changeset viewer.