Make WordPress Core

Changeset 45160


Ignore:
Timestamp:
04/11/2019 05:29:20 PM (6 years ago)
Author:
johnbillion
Message:

Build/Test tools: Add some docs to the test functions.

Props andizer

Fixes #46501

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/functions.php

    r44812 r45160  
    33/**
    44 * Retrieves PHPUnit runner version.
     5 *
     6 * @return double The version number.
    57 */
    68function tests_get_phpunit_version() {
     
    135137}
    136138
     139/**
     140 * Handles the WP die handler by outputting the given values as text.
     141 *
     142 * @param string $message The message.
     143 * @param string $title   The title.
     144 * @param array  $args    Array with arguments.
     145 */
    137146function _wp_die_handler( $message, $title = '', $args = array() ) {
    138147    if ( ! $GLOBALS['_wp_die_disabled'] ) {
     
    143152}
    144153
     154/**
     155 * Disables the WP die handler.
     156 */
    145157function _disable_wp_die() {
    146158    $GLOBALS['_wp_die_disabled'] = true;
    147159}
    148160
     161/**
     162 * Enables the WP die handler.
     163 */
    149164function _enable_wp_die() {
    150165    $GLOBALS['_wp_die_disabled'] = false;
    151166}
    152167
     168/**
     169 * Returns the die handler.
     170 *
     171 * @return string The die handler.
     172 */
    153173function _wp_die_handler_filter() {
    154174    return '_wp_die_handler';
    155175}
    156176
     177/**
     178 * Returns the die handler.
     179 *
     180 * @return string The die handler.
     181 */
    157182function _wp_die_handler_filter_exit() {
    158183    return '_wp_die_handler_exit';
    159184}
    160185
     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 */
    161193function _wp_die_handler_txt( $message, $title, $args ) {
    162194    echo "\nwp_die called\n";
     
    171203}
    172204
     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 */
    173212function _wp_die_handler_exit( $message, $title, $args ) {
    174213    echo "\nwp_die called\n";
     
    198237/**
    199238 * 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.
    200241 */
    201242function _upload_dir_no_subdir( $uploads ) {
     
    211252/**
    212253 * Helper used with the `upload_dir` filter to set https upload URL.
     254 *
     255 * @return array The altered array.
    213256 */
    214257function _upload_dir_https( $uploads ) {
     
    221264/**
    222265 * Use the Spy_REST_Server class for the REST server.
     266 *
     267 * @return string The server class name.
    223268 */
    224269function _wp_rest_server_class_filter() {
Note: See TracChangeset for help on using the changeset viewer.