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

expectedException is deprecated in phpunit 8 #68

Closed
wants to merge 1 commit into from

Conversation

DQNEO
Copy link
Contributor

@DQNEO DQNEO commented Jan 17, 2020

It's deprecated in PHPUnit8, and will be removed in PHPUnit9
sebastianbergmann/phpunit#3332

@ExpectedException causes a warning as follows.

The @ExpectedException, @expectedExceptionCode, @expectedExceptionMessage, and @expectedExceptionMessageRegExp annotations are deprecated. They will be removed in PHPUnit 9. Refactor your test to use expectException(), expectExceptionCode(), expectExceptionMessage(), or expectExceptionMessageRegExp() instead.

@Jean85
Copy link
Member

Jean85 commented Jan 17, 2020

This is not mergeable as-is. This package lacks any kind of CI nor it requires PHPUnit as a dependency, so we cannot say which version we can use; in particular, this package is usable back to PHP 5.3, so that's a big problem...

@DQNEO
Copy link
Contributor Author

DQNEO commented Jan 17, 2020

Thanks for the comment.
Actually I wanted to raise an issue instead of making a PR, but issues are disabled in this repo so I made this PR to make a discussion.

As you say, there is no declaration of dependency on PHPUnit in package.json.
But the presence of @expectedException implicitly limits the PHPUnit version to < 9.0 , so it will break CI of other packages which inherits LoggerInterfaceTest.
e.g. https://travis-ci.org/Seldaek/monolog/jobs/628326254#L384 (not broken yet, but will be broken )

IMHO It's time to consider whether having abstract class LoggerInterfaceTest extends TestCase without explicit version constraint is good or not.

@Jean85
Copy link
Member

Jean85 commented Jan 17, 2020

We actually discussed this multiple times, but the crucial point here is that we would need to split the tests into a separate package probably.

@DQNEO
Copy link
Contributor Author

DQNEO commented Oct 5, 2020

we would need to split the tests into a separate package probably.

Agree.

Then we don't need this PR any more.

@DQNEO DQNEO closed this Oct 5, 2020
@DQNEO DQNEO deleted the fix-phpunit-warning branch October 5, 2020 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants