-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #4641: Added assertions assertStringEqualIgnoringLineEndings and assertStringContainsStringIgnoringLineEndings #4670
Conversation
Thank you for your contribution. I appreciate the time you invested in preparing this pull request. However, this introduces a new feature. As such, the pull request must be made against |
…nd `PHPUnit\Framework\assertStringContainsStringIgnoringLineEndings`.
Ok, I'm rebase code to master branch |
Merged manually, thanks. |
This will be available only in 10 version? |
…sertStringEqualsStringIgnoringLineEndings() et al methods PHPUnit 10.0.0 introduces the new `Assert::assertStringEqualsStringIgnoringLineEndings()` and `Assert::assertStringContainsStringIgnoringLineEndings()` methods. This commit: * Adds two traits with the same name. One to polyfill the methods when not available in PHPUnit. The other - an empty trait - to allow for `use`-ing the trait in PHPUnit versions in which the methods are already natively available. * Logic to the custom autoloader which will load the correct trait depending on the PHPUnit version used. * An availability test and limited functional test for the functionality polyfilled. Note: the function name for the `private` `normalizeLineEndings()` method is a little convoluted - `normalizeLineEndingsForIgnoringLineEndingsAssertions()`. This is intentional to prevent potential naming collisions with pre-existing end-user defined methods for the same, which may exist in other traits used in tests, which would be hard to solve due to the method only existing in the non-empty trait. Includes: * Adding the new polyfill to the existing `TestCases` classes. Refs: * sebastianbergmann/phpunit#4641 * sebastianbergmann/phpunit#4670 (and follow up commits) * sebastianbergmann/phpunit#5279 Co-authored-by: Sergei Predvoditelev <[email protected]> Co-authored-by: Sebastian Bergmann <[email protected]>
…sertStringEqualsStringIgnoringLineEndings() et al methods PHPUnit 10.0.0 introduces the new `Assert::assertStringEqualsStringIgnoringLineEndings()` and `Assert::assertStringContainsStringIgnoringLineEndings()` methods. This commit: * Adds two traits with the same name. One to polyfill the methods when not available in PHPUnit. The other - an empty trait - to allow for `use`-ing the trait in PHPUnit versions in which the methods are already natively available. * Logic to the custom autoloader which will load the correct trait depending on the PHPUnit version used. * An availability test and limited functional test for the functionality polyfilled. Note: the function name for the `private` `normalizeLineEndings()` method is a little convoluted - `normalizeLineEndingsForIgnoringLineEndingsAssertions()`. This is intentional to prevent potential naming collisions with pre-existing end-user defined methods for the same, which may exist in other traits used in tests, which would be hard to solve due to the method only existing in the non-empty trait. Includes: * Adding the new polyfill to the existing `TestCases` classes. Refs: * sebastianbergmann/phpunit#4641 * sebastianbergmann/phpunit#4670 (and follow up commits) * sebastianbergmann/phpunit#5279 Co-authored-by: Sergei Predvoditelev <[email protected]> Co-authored-by: Sebastian Bergmann <[email protected]>
…sertStringEqualsStringIgnoringLineEndings() et al methods PHPUnit 10.0.0 introduces the new `Assert::assertStringEqualsStringIgnoringLineEndings()` and `Assert::assertStringContainsStringIgnoringLineEndings()` methods. This commit: * Adds two traits with the same name. One to polyfill the methods when not available in PHPUnit. The other - an empty trait - to allow for `use`-ing the trait in PHPUnit versions in which the methods are already natively available. * Logic to the custom autoloader which will load the correct trait depending on the PHPUnit version used. * An availability test and limited functional test for the functionality polyfilled. Note: the function name for the `private` `normalizeLineEndings()` method is a little convoluted - `normalizeLineEndingsForIgnoringLineEndingsAssertions()`. This is intentional to prevent potential naming collisions with pre-existing end-user defined methods for the same, which may exist in other traits used in tests, which would be hard to solve due to the method only existing in the non-empty trait. Includes: * Adding the new polyfill to the existing `TestCases` classes. Refs: * sebastianbergmann/phpunit#4641 * sebastianbergmann/phpunit#4670 (and follow up commits) * sebastianbergmann/phpunit#5279 Co-authored-by: Sergei Predvoditelev <[email protected]> Co-authored-by: Sebastian Bergmann <[email protected]>
…sertStringEqualsStringIgnoringLineEndings() et al methods PHPUnit 10.0.0 introduces the new `Assert::assertStringEqualsStringIgnoringLineEndings()` and `Assert::assertStringContainsStringIgnoringLineEndings()` methods. This commit: * Adds two traits with the same name. One to polyfill the methods when not available in PHPUnit. The other - an empty trait - to allow for `use`-ing the trait in PHPUnit versions in which the methods are already natively available. * Logic to the custom autoloader which will load the correct trait depending on the PHPUnit version used. * An availability test and limited functional test for the functionality polyfilled. Note: the function name for the `private` `normalizeLineEndings()` method is a little convoluted - `normalizeLineEndingsForIgnoringLineEndingsAssertions()`. This is intentional to prevent potential naming collisions with pre-existing end-user defined methods for the same, which may exist in other traits used in tests, which would be hard to solve due to the method only existing in the non-empty trait. Includes: * Adding the new polyfill to the existing `TestCases` classes. Refs: * sebastianbergmann/phpunit#4641 * sebastianbergmann/phpunit#4670 (and follow up commits) * sebastianbergmann/phpunit#5279 Co-authored-by: Sergei Predvoditelev <[email protected]> Co-authored-by: Sebastian Bergmann <[email protected]>
Fix #4641
Added assertions
PHPUnit\Framework\assertStringEqualIgnoringLineEndings
andPHPUnit\Framework\assertStringContainsStringIgnoringLineEndings
.