Make WordPress Core


Ignore:
Timestamp:
10/29/2019 02:26:41 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Build/Test Tools: Ignore EOL differences in tests using multiline string assertions.

Unix vs. Windows EOL style mismatches can cause misleading failures in tests using the heredoc syntax (<<<) or multiline strings as the expected result.

Fixes #31432. See #42594, #47411.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/post/template.php

    r46586 r46612  
    165165
    166166        $output = wp_dropdown_pages( array( 'echo' => 0 ) );
    167         $this->assertEquals( $lineage, $output );
     167        $this->assertEqualsIgnoreEOL( $lineage, $output );
    168168
    169169        $depth = <<<DEPTH
     
    180180            )
    181181        );
    182         $this->assertEquals( $depth, $output );
     182        $this->assertEqualsIgnoreEOL( $depth, $output );
    183183
    184184        $option_none = <<<NONE
     
    198198            )
    199199        );
    200         $this->assertEquals( $option_none, $output );
     200        $this->assertEqualsIgnoreEOL( $option_none, $output );
    201201
    202202        $option_no_change = <<<NO
     
    208208
    209209NO;
    210         $output           = wp_dropdown_pages(
     210
     211        $output = wp_dropdown_pages(
    211212            array(
    212213                'echo'                  => 0,
     
    217218            )
    218219        );
    219         $this->assertEquals( $option_no_change, $output );
     220        $this->assertEqualsIgnoreEOL( $option_no_change, $output );
    220221    }
    221222
Note: See TracChangeset for help on using the changeset viewer.