Make WordPress Core


Ignore:
Timestamp:
03/01/2023 03:56:39 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Tests: Ignore EOL differences in a wpautop() test for <math> block elements.

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

This commit resolves a failure when running the test suite on Windows:

1) Tests_Formatting_wpAutop::test_skip_block_math_elements
Failed asserting that two strings are identical.
...
#Warning: Strings contain different line endings!

Follow-up to [55272].

Props davidbaumwald, ignatggeorgiev, sakibmd.
Fixes #57718.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/formatting/wpAutop.php

    r55272 r55445  
    159159</math>';
    160160
    161                 $this->assertSame( "<p>$str</p>", trim( wpautop( $str ) ) );
     161                $this->assertSameIgnoreEOL( "<p>$str</p>", trim( wpautop( $str ) ) );
    162162        }
    163163
Note: See TracChangeset for help on using the changeset viewer.