Skip to content

Migrate deprecated test annotations to assertions #56

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

Closed
wants to merge 2 commits into from
Closed

Migrate deprecated test annotations to assertions #56

wants to merge 2 commits into from

Conversation

flavioheleno
Copy link
Contributor

@flavioheleno flavioheleno commented Dec 29, 2020

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Related tickets none
Documentation if this is a new feature, link to pull request in https://github.com/php-http/documentation that adds relevant documentation
License MIT

What's in this PR?

There are 5 tests using deprecated test annotations and although they are not an issue right now, they are quite annoying when you are working with the library development. This PR replaces the deprecated annotations with the proper assertions.

1) Http\Client\Socket\Tests\SocketHttpClientTest::testNoRemote
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 expectExceptionMessageMatches() instead.

2) Http\Client\Socket\Tests\SocketHttpClientTest::testBrokenSocket
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 expectExceptionMessageMatches() instead.

3) Http\Client\Socket\Tests\SocketHttpClientTest::testNetworkExceptionOnConnectError
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 expectExceptionMessageMatches() instead.

4) Http\Client\Socket\Tests\SocketHttpClientTest::testNetworkExceptionOnSslError
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 expectExceptionMessageMatches() instead.

5) Http\Client\Socket\Tests\StreamTest::testTimeout
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 expectExceptionMessageMatches() instead.

Why?

Why not?

Checklist

  • Updated CHANGELOG.md to describe BC breaks / deprecations | new feature | bugfix
  • Documentation pull request created (if not simply a bugfix)

^ This PR does not change the library itself and I could not find anything like that on the CHANGELOG.md, therefore I have updated it nor documented it anywhere else to be honest.

@joelwurtz
Copy link
Member

Thanks for this and you others PR, i want to move to github actions first (so we can be sure that tests are ok) before merging this, but got no time ATM to do that, will merge later then.

@flavioheleno
Copy link
Contributor Author

@joelwurtz I'm glad to help with GA migration if you wish.

@dbu
Copy link
Contributor

dbu commented Aug 19, 2022

thanks for the contribution! sorry that this went under. meanwhile, the exception expectation is converted to assertions.

@dbu dbu closed this Aug 19, 2022
@flavioheleno flavioheleno deleted the fix/migrate-tests branch August 19, 2022 16:21
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

Successfully merging this pull request may close these issues.

3 participants