Ticket #46501: 46501.diff
File 46501.diff, 2.7 KB (added by , 6 years ago) |
---|
-
tests/phpunit/includes/functions.php
2 2 3 3 /** 4 4 * Retrieves PHPUnit runner version. 5 * 6 * @return double The version number. 5 7 */ 6 8 function tests_get_phpunit_version() { 7 9 if ( class_exists( 'PHPUnit_Runner_Version' ) ) { … … 134 136 } 135 137 } 136 138 139 /** 140 * Handles the WP die handler by outputting the given values as a text. 141 * 142 * @param string $message The message. 143 * @param string $title The title. 144 * @param array $args Array with arguments. 145 */ 137 146 function _wp_die_handler( $message, $title = '', $args = array() ) { 138 147 if ( ! $GLOBALS['_wp_die_disabled'] ) { 139 148 _wp_die_handler_txt( $message, $title, $args ); … … 142 151 } 143 152 } 144 153 154 /** 155 * Disables the WP die. 156 */ 145 157 function _disable_wp_die() { 146 158 $GLOBALS['_wp_die_disabled'] = true; 147 159 } 148 160 161 /** 162 * Enables the WP die. 163 */ 149 164 function _enable_wp_die() { 150 165 $GLOBALS['_wp_die_disabled'] = false; 151 166 } 152 167 168 /** 169 * Returns the die handler. 170 * 171 * @return string The die handler. 172 */ 153 173 function _wp_die_handler_filter() { 154 174 return '_wp_die_handler'; 155 175 } 156 176 177 /** 178 * Returns the die handler. 179 * 180 * @return string The die handler. 181 */ 157 182 function _wp_die_handler_filter_exit() { 158 183 return '_wp_die_handler_exit'; 159 184 } 160 185 186 /** 187 * Dies without an exit. 188 * 189 * @param string $message The message. 190 * @param string $title The title. 191 * @param array $args Array with arguments. 192 */ 161 193 function _wp_die_handler_txt( $message, $title, $args ) { 162 194 echo "\nwp_die called\n"; 163 195 echo "Message : $message\n"; … … 170 202 } 171 203 } 172 204 205 /** 206 * Dies with an exit. 207 * 208 * @param string $message The message. 209 * @param string $title The title. 210 * @param array $args Array with arguments. 211 */ 173 212 function _wp_die_handler_exit( $message, $title, $args ) { 174 213 echo "\nwp_die called\n"; 175 214 echo "Message : $message\n"; … … 197 236 198 237 /** 199 238 * Helper used with the `upload_dir` filter to remove the /year/month sub directories from the uploads path and URL. 239 * 240 * @return array The altered array. 200 241 */ 201 242 function _upload_dir_no_subdir( $uploads ) { 202 243 $subdir = $uploads['subdir']; … … 210 251 211 252 /** 212 253 * Helper used with the `upload_dir` filter to set https upload URL. 254 * 255 * @return array The altered array. 213 256 */ 214 257 function _upload_dir_https( $uploads ) { 215 258 $uploads['url'] = str_replace( 'http://', 'https://', $uploads['url'] ); … … 220 263 221 264 /** 222 265 * Use the Spy_REST_Server class for the REST server. 266 * 267 * @return string The server class name. 223 268 */ 224 269 function _wp_rest_server_class_filter() { 225 270 return 'Spy_REST_Server';