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/formatting/Autop.php

    r46586 r46612  
    503503line 5</p>';
    504504
    505         $this->assertEquals( $expected, trim( wpautop( $content ) ) );
     505        $this->assertEqualsIgnoreEOL( $expected, trim( wpautop( $content ) ) );
    506506    }
    507507
     
    522522<p>line 2</p>';
    523523
    524         $this->assertEquals( $expected, trim( wpautop( $content ) ) );
     524        $this->assertEqualsIgnoreEOL( $expected, trim( wpautop( $content ) ) );
    525525    }
    526526
     
    544544     * @ticket 39307
    545545     */
    546     function test_that_wpautop_doses_not_add_extra_closing_p_in_figure() {
     546    function test_that_wpautop_does_not_add_extra_closing_p_in_figure() {
    547547        $content1  = '<figure><img src="example.jpg" /><figcaption>Caption</figcaption></figure>';
    548548        $expected1 = $content1;
     
    557557
    558558        $this->assertEquals( $expected1, trim( wpautop( $content1 ) ) );
    559         $this->assertEquals( $expected2, trim( wpautop( $content2 ) ) );
     559        $this->assertEqualsIgnoreEOL( $expected2, trim( wpautop( $content2 ) ) );
    560560    }
    561561
     
    585585        $expected = '<p>' . $content . '</p>';
    586586
    587         $this->assertEquals( $expected, trim( wpautop( $content ) ) );
     587        $this->assertEqualsIgnoreEOL( $expected, trim( wpautop( $content ) ) );
    588588    }
    589589
     
    601601        $expected = '<p>' . $content . '</p>';
    602602
    603         $this->assertEquals( $expected, trim( wpautop( $content ) ) );
     603        $this->assertEqualsIgnoreEOL( $expected, trim( wpautop( $content ) ) );
    604604    }
    605605}
Note: See TracChangeset for help on using the changeset viewer.