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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate annotation(s) for expecting exceptions #3332

Closed
sebastianbergmann opened this issue Oct 10, 2018 · 4 comments
Closed

Deprecate annotation(s) for expecting exceptions #3332

sebastianbergmann opened this issue Oct 10, 2018 · 4 comments
Assignees
Milestone

Comments

@sebastianbergmann
Copy link
Owner

No description provided.

@sebastianbergmann sebastianbergmann added this to the PHPUnit 7.5 milestone Oct 10, 2018
@sebastianbergmann sebastianbergmann self-assigned this Oct 10, 2018
@keradus
Copy link
Contributor

keradus commented Oct 10, 2018

Note for interested folks:
PHP CS Fixer has a rule to automatically apply this change and convert those annotations into methods call: php_unit_no_expectation_annotation

@keradus
Copy link
Contributor

keradus commented Oct 10, 2018

@sebastianbergmann , would it make sense to deprecate those annotations at 7.5 and drop at 8.0 ?
As always, I'm happy to help on that

@sebastianbergmann
Copy link
Owner Author

While I initially wanted to do that, I do not think that the two months between December and February are enough for a deprecation period.

@keradus
Copy link
Contributor

keradus commented Oct 11, 2018

I believe it's fine - one thing is that it's not that short - but other, not everyone will migrate to new MAJOR at beginning of February.

looking at packagist stats ( https://repo-stats.github.io ), fragmentation is big
screenshot from 2018-10-11 13-48-38

for that, I believe it's worth to do it now instead of setting up a deprecation that would live for more than year.

DavertMik pushed a commit to Codeception/Codeception that referenced this issue Oct 18, 2018
* Asserts: add expectThrowable()

With this method you can not only test Exceptions, like with expectException, but also Errors.

Signed-off-by: Bernd Stellwag <burned@zerties.org>

* Asserts tests: set up test class in setUp()

Signed-off-by: Bernd Stellwag <burned@zerties.org>

* Asserts: mention expectThrowable in the documentation

Signed-off-by: Bernd Stellwag <burned@zerties.org>

* Asserts: add type hint

Signed-off-by: Bernd Stellwag <burned@zerties.org>

* Asserts: since we marked expectedException as deprecated, use expectThrowable instead

Signed-off-by: Bernd Stellwag <burned@zerties.org>

* fix typos

Signed-off-by: Bernd Stellwag <burned@zerties.org>

* Asserts: try to make expectThrowable compatible with PHP 5.6 again

Signed-off-by: Bernd Stellwag <burned@zerties.org>

* don't use @ExpectedException annotation as it will get deprecated

see sebastianbergmann/phpunit#3332
Naktibalda pushed a commit to Codeception/module-asserts that referenced this issue Sep 16, 2019
* Asserts: add expectThrowable()

With this method you can not only test Exceptions, like with expectException, but also Errors.

Signed-off-by: Bernd Stellwag <burned@zerties.org>

* Asserts tests: set up test class in setUp()

Signed-off-by: Bernd Stellwag <burned@zerties.org>

* Asserts: mention expectThrowable in the documentation

Signed-off-by: Bernd Stellwag <burned@zerties.org>

* Asserts: add type hint

Signed-off-by: Bernd Stellwag <burned@zerties.org>

* Asserts: since we marked expectedException as deprecated, use expectThrowable instead

Signed-off-by: Bernd Stellwag <burned@zerties.org>

* fix typos

Signed-off-by: Bernd Stellwag <burned@zerties.org>

* Asserts: try to make expectThrowable compatible with PHP 5.6 again

Signed-off-by: Bernd Stellwag <burned@zerties.org>

* don't use @ExpectedException annotation as it will get deprecated

see sebastianbergmann/phpunit#3332
Naktibalda pushed a commit to Codeception/module-asserts that referenced this issue Sep 19, 2019
* Asserts: add expectThrowable()

With this method you can not only test Exceptions, like with expectException, but also Errors.

Signed-off-by: Bernd Stellwag <burned@zerties.org>

* Asserts tests: set up test class in setUp()

Signed-off-by: Bernd Stellwag <burned@zerties.org>

* Asserts: mention expectThrowable in the documentation

Signed-off-by: Bernd Stellwag <burned@zerties.org>

* Asserts: add type hint

Signed-off-by: Bernd Stellwag <burned@zerties.org>

* Asserts: since we marked expectedException as deprecated, use expectThrowable instead

Signed-off-by: Bernd Stellwag <burned@zerties.org>

* fix typos

Signed-off-by: Bernd Stellwag <burned@zerties.org>

* Asserts: try to make expectThrowable compatible with PHP 5.6 again

Signed-off-by: Bernd Stellwag <burned@zerties.org>

* don't use @ExpectedException annotation as it will get deprecated

see sebastianbergmann/phpunit#3332
franmomu added a commit to franmomu/DoctrineMongoDBBundle that referenced this issue Oct 21, 2020
The annotations expectedException and expectedExceptionMessage
has been replace with the corresponding expecting exceptions, ref:
sebastianbergmann/phpunit#3332

Also a call to TestCase::assertInternalType has been replaced
with TestCase::assertIsInt.
franmomu added a commit to franmomu/DoctrineMongoDBBundle that referenced this issue Nov 28, 2020
The annotations expectedException and expectedExceptionMessage
has been replace with the corresponding expecting exceptions, ref:
sebastianbergmann/phpunit#3332

Also a call to TestCase::assertInternalType has been replaced
with TestCase::assertIsInt.
franmomu added a commit to franmomu/DoctrineMongoDBBundle that referenced this issue Nov 30, 2020
The annotations expectedException and expectedExceptionMessage
has been replace with the corresponding expecting exceptions, ref:
sebastianbergmann/phpunit#3332

Also a call to TestCase::assertInternalType has been replaced
with TestCase::assertIsInt.
franmomu added a commit to franmomu/DoctrineMongoDBBundle that referenced this issue Dec 3, 2020
The annotations expectedException and expectedExceptionMessage
has been replace with the corresponding expecting exceptions, ref:
sebastianbergmann/phpunit#3332

Also a call to TestCase::assertInternalType has been replaced
with TestCase::assertIsInt.
vitormattos added a commit to LibreCodeCoop/php-swagger-test that referenced this issue May 29, 2021
ordago added a commit to ordago/sermepa that referenced this issue Jun 14, 2021
pH-7 added a commit to pH7Software/pH7-Social-Dating-CMS that referenced this issue Jan 2, 2022
GoreSakuraba pushed a commit to GoreSakuraba/php-openapi-test that referenced this issue Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants