-
-
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
Proposal: split assertContains for iterables and non-iterables #3422
Comments
I interpret this as
Correct? |
Going further, we probably want to get rid of the optional parameters and introduce
etc. |
@keradus Can you please have a look at master...686d153? Thanks! |
Hi ! First of all, glad you like the idea !
can you elaborate how you define difference of
I would rather promote strict comparison by default. Language itself is promoting to be strict about types now, let's not promote (by more convenient (/shorter) name) being not strict.
can you raise it as a PR? with link provided, I can't do the comments :( |
|
Sorry, but I do not send myself pull requests. |
I agree with promoting strict comparison, but the naming as-is makes more sense to me somehow. |
* Revert deprecation of assertContains() and assertNotContains() * Revert addition of assertIterableContains(), assertIterableContainsSame(), assertIterableNotContains(), and assertIterableNotContainsSame() * Deprecate using assertContains() and assertNotContains() on string haystacks * Deprecate the optional parameters $ignoreCase, $checkForObjectIdentity, and $checkForNonObjectIdentity of assertContains() and assertNotContains()
The old way is deprecated from phpunit 8.0 sebastianbergmann/phpunit#3422
...and require phpunit >7.5 for assertStringContainsString See sebastianbergmann/phpunit#3422
…sString()` ... when used with strings. Using `assertContains()` and `assertNotContains()` with string haystacks was soft deprecated in PHPUnit 7.5, hard deprecated in PHPUnit 8.0 and the functionality was removed in PHPUnit 9.0. For string haystacks, the `assertStringContainsString()`, `assertStringContainsStringIgnoringCase()`, `assertStringNotContainsString()` and `assertStringNotContainsStringIgnoringCase()` were introduced as replacements in PHPUnit 7.5. Ref: * https://github.com/sebastianbergmann/phpunit/blob/7.5.20/ChangeLog-7.5.md#750---2018-12-07 * sebastianbergmann/phpunit#3422
…sString()` ... when used with strings. Using `assertContains()` and `assertNotContains()` with string haystacks was soft deprecated in PHPUnit 7.5, hard deprecated in PHPUnit 8.0 and the functionality was removed in PHPUnit 9.0. For string haystacks, the `assertStringContainsString()`, `assertStringContainsStringIgnoringCase()`, `assertStringNotContainsString()` and `assertStringNotContainsStringIgnoringCase()` were introduced as replacements in PHPUnit 7.5. Ref: * https://github.com/sebastianbergmann/phpunit/blob/7.5.20/ChangeLog-7.5.md#750---2018-12-07 * sebastianbergmann/phpunit#3422
…sString()` ... when used with strings. Using `assertContains()` and `assertNotContains()` with string haystacks was soft deprecated in PHPUnit 7.5, hard deprecated in PHPUnit 8.0 and the functionality was removed in PHPUnit 9.0. For string haystacks, the `assertStringContainsString()`, `assertStringContainsStringIgnoringCase()`, `assertStringNotContainsString()` and `assertStringNotContainsStringIgnoringCase()` were introduced as replacements in PHPUnit 7.5. Ref: * https://github.com/sebastianbergmann/phpunit/blob/7.5.20/ChangeLog-7.5.md#750---2018-12-07 * sebastianbergmann/phpunit#3422
Both assertContains() and assertNotContains() are deprecated in PHPUnit 8 for operations on strings. Also the optional case parameter is. All uses must be changed to one of: - assertStringContainsString() - assertStringContainsStringIgnoringCase() - assertStringNotContainsString() - assertStringNotContainsStringIgnoringCase() More info: sebastianbergmann/phpunit#3422 Regexp to find all uses: ag 'assert(Not)?Contains\('
Both assertContains() and assertNotContains() are deprecated in PHPUnit 8 for operations on strings. Also the optional case parameter is. All uses must be changed to one of: - assertStringContainsString() - assertStringContainsStringIgnoringCase() - assertStringNotContainsString() - assertStringNotContainsStringIgnoringCase() More info: sebastianbergmann/phpunit#3422 Regexp to find all uses: ag 'assert(Not)?Contains\('
Both assertContains() and assertNotContains() are deprecated in PHPUnit 8 for operations on strings. Also the optional case parameter is. All uses must be changed to one of: - assertStringContainsString() - assertStringContainsStringIgnoringCase() - assertStringNotContainsString() - assertStringNotContainsStringIgnoringCase() More info: sebastianbergmann/phpunit#3422 Regexp to find all uses: ag 'assert(Not)?Contains\('
The old way is deprecated from phpunit 8.0 sebastianbergmann/phpunit#3422
PHPUnit 8 specializes several assertion methods: - sebastianbergmann/phpunit#3368 - sebastianbergmann/phpunit#3422 (comment)
PHPUnit 8 specializes several assertion methods: - sebastianbergmann/phpunit#3368 - sebastianbergmann/phpunit#3422 (comment)
currently, one can do both with a single assertion:
which is confusing if someone use it like the following, and for that error prone due to accidental lack of types control
what about splitting the responsibility of that assertion, to have one for strings and one for iterables ?
ref PHP-CS-Fixer/PHP-CS-Fixer#4061
The text was updated successfully, but these errors were encountered: