Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPUnit 9.6 misses deprecations for assertions and constraints removed in PHPUnit 10 #5160

Closed
verfriemelt-dot-org opened this issue Feb 3, 2023 · 2 comments
Labels
type/bug Something is broken type/deprecation Something will be/is deprecated version/9 Something affects PHPUnit 9

Comments

@verfriemelt-dot-org
Copy link

Q A
PHPUnit version 10.0.1
PHP version 8.2.2
Installation Method Composer

Summary

i have no deprecations warnings about that method in 9.5 nor 9.6 but tests break with 10 馃
shouldn't there be at least a deprecation warning?

maybe this was missed due to being planned for phpunit 11 previously?

#4602

thank you for you great effort :) really appreciate it!

@verfriemelt-dot-org verfriemelt-dot-org added the type/bug Something is broken label Feb 3, 2023
@sebastianbergmann sebastianbergmann added version/9 Something affects PHPUnit 9 type/deprecation Something will be/is deprecated labels Feb 3, 2023
@sebastianbergmann sebastianbergmann changed the title phpunit 10: assertObjectNotHasAttribute() removed while not being deprecated before PHPUnit 9.6 misses deprecations for assertions and constraints removed in PHPUnit 10 Feb 3, 2023
@verfriemelt-dot-org
Copy link
Author

thanks for your quick fix :)

@stronk7
Copy link
Contributor

stronk7 commented Jul 26, 2023

Hi,

I've commented in a few issues about the same, sorry for the spam... isn't it a little bit useless to get the warnings in the 9.x series without getting also the replacements?

There are a lot of people still needing to run tests for php <= 80 and these new warnings are generating all that noise without any way to get it sorted out other than changing tests to an interim solution (assertTrue(property_exists(...)) or implementing the "assertions" in own testcase classes... or other hacks.

Ideally, the versions where a warning is created should get, always, the new counterparts (when available). And, in this case, there are new counterparts (assertObjectHas[Not]Property(), ...) to move the assertions to.

Just my 2 cents, surprised with some good hundreds of unexpected warnings after updating composer dependencies here, heh.

Ciao :-)

stronk7 added a commit to stronk7/moodle that referenced this issue Aug 4, 2023
This bumps direct dependencies to current ones:

- phpunit: 9.5.x No updates here, there is the 9.6.x series
  available but a lot of deprecation warnings have been
  introduced there without any alternative to use. See:
  - sebastianbergmann/phpunit#5160
  - sebastianbergmann/phpunit#5062
  - ...
  While that will be handy to prepare ourselves to PHPUnit 10
  in some months... we cannot force everybody to jump to 9.6.x
  because that will make a lot of tests to start emitting
  warnings.
  So we stay with PHPUnit 9.5.x for the life of this branch.
- mink-phpwebdriver: 1.2.1 No updates here, just changed the
  constraint because we cannot advance to 1.3.x yet, there is
  a change there causing some app tests to fail. See:
  - oleg-andreyev/MinkPhpWebDriver#81
  So we stay with 1.2.x until that issue is fixed/clarified,
  only then we'll review the status.
- behat: 3.12.x => 3.13.x

And also, automatically, a bunch of 2nd and deepest dependencies.

Generated with php80 that is the lowest php version supported
by this branch and, also, by some of the dependencies, as per
documented @ https://moodledev.io/general/development/tools/composer

Worth mentioning behat/mink-goutte-driver, that we should move
to mink-browserkit-driver, but that's out from this issue scope.
stronk7 added a commit to stronk7/moodle that referenced this issue Aug 4, 2023
This bumps direct dependencies to current ones:

- phpunit: 9.5.x No updates here, there is the 9.6.x series
  available but a lot of deprecation warnings have been
  introduced there without any alternative to use. See:
  - sebastianbergmann/phpunit#5160
  - sebastianbergmann/phpunit#5062
  - ...
  While that will be handy to prepare ourselves to PHPUnit 10
  in some months... we cannot force everybody to jump to 9.6.x
  because that will make a lot of tests to start emitting
  warnings.
  So we stay with PHPUnit 9.5.x for the life of this branch.
- mink-phpwebdriver: 1.2.1 No updates here, just changed the
  constraint because we cannot advance to 1.3.x yet, there is
  a change there causing some app tests to fail. See:
  - oleg-andreyev/MinkPhpWebDriver#81
  So we stay with 1.2.x until that issue is fixed/clarified,
  only then we'll review the status.
- behat: 3.12.x => 3.13.x

And also, automatically, a bunch of 2nd and deepest dependencies.

Generated with php80 that is the lowest php version supported
by this branch and, also, by some of the dependencies, as per
documented @ https://moodledev.io/general/development/tools/composer

Worth mentioning behat/mink-goutte-driver, that we should move
to mink-browserkit-driver, but that's out from this issue scope.
stronk7 added a commit to stronk7/moodle that referenced this issue Aug 5, 2023
This bumps direct dependencies to current ones:

- phpunit: 9.5.x No updates here, there is the 9.6.x series
  available but a lot of deprecation warnings have been
  introduced there without any alternative to use. See:
  - sebastianbergmann/phpunit#5160
  - sebastianbergmann/phpunit#5062
  - ...
  While that will be handy to prepare ourselves to PHPUnit 10
  in some months... we cannot force everybody to jump to 9.6.x
  because that will make a lot of tests to start emitting
  warnings.
  So we stay with PHPUnit 9.5.x for the life of this branch.
- mink-phpwebdriver: 1.2.1 No updates here, just changed the
  constraint because we cannot advance to 1.3.x yet, there is
  a change there causing some app tests to fail. See:
  - oleg-andreyev/MinkPhpWebDriver#81
  So we stay with 1.2.x until that issue is fixed/clarified,
  only then we'll review the status.
- behat: 3.12.x => 3.13.x

And also, automatically, a bunch of 2nd and deepest dependencies.

Generated with php74 that is the lowest php version supported
by this branch and, also, by some of the dependencies, as per
documented @ https://moodledev.io/general/development/tools/composer

Worth mentioning behat/mink-goutte-driver, that we should move
to mink-browserkit-driver, but that's out from this issue scope.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something is broken type/deprecation Something will be/is deprecated version/9 Something affects PHPUnit 9
Projects
None yet
Development

No branches or pull requests

3 participants