Make WordPress Core

Ticket #46798: 46798.diff

File 46798.diff, 1.0 KB (added by azaozz, 5 years ago)
  • tests/phpunit/includes/functions.php

     
    291291        remove_action( 'init', 'register_block_core_tag_cloud' );
    292292}
    293293tests_add_filter( 'init', '_unhook_block_registration', 1000 );
     294
     295/**
     296 * Simple helper for line endings normalization.
     297 */
     298function _normalize_eol( $str ) {
     299        return str_replace( array( "\r\n", "\r" ), "\n", $str );
     300}
  • tests/phpunit/includes/utils.php

     
    312312function get_echo( $callable, $args = array() ) {
    313313        ob_start();
    314314        call_user_func_array( $callable, $args );
    315         return ob_get_clean();
     315        return _normalize_eol( ob_get_clean() );
    316316}
    317317
    318318// recursively generate some quick assertEquals tests based on an array