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

ChunkedEncodingTest: improve tests #581

Merged
merged 7 commits into from
Oct 18, 2021

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Oct 17, 2021

ChunkedEncodingTest: move to subdirectory

There are a number of test classes which all directly relate to the WpOrg\Requests\Requests class.

Having those test files/classes all in the tests root directory does not make it any clearer what these tests are actually testing. So, I'm proposing that if a class warrants multiple test classes, we create a directory named after the class and place the files in that directory.

ChunkedEncodingTest: reorder methods

Move the data providers down to just below the test they apply to.

ChunkedEncodingTest: rename dataprovider methods

... to mirror the name of the test the data provider belongs with.

ChunkedEncodingTest: improve data provider

  • Add keys to the entries in each data set.

ChunkedEncodingTest: add one extra test

Just adding one extra test to document the behaviour when an empty string is passed.

As this is a protected method, I deem stringent input validation unnecessary.

ChunkedEncodingTest: stabilize the tests

  • Verify that $response is an instance of the Response class before approaching it as such.
  • Add the $message parameter to all assertions.

ChunkedEncodingTest: improve documentation

Includes adding @covers tag.

Related to #497

There are a number of test classes which all directly relate to the `WpOrg\Requests\Requests` class.

Having those test files/classes all in the `tests` root directory does not make it any clearer what these tests are actually testing. So, I'm proposing that if a class warrants multiple test classes, we create a directory named after the class and place the files in that directory.
Move the data providers down to just below the test they apply to.
@jrfnl jrfnl added this to the 2.0.0 milestone Oct 17, 2021
@jrfnl jrfnl requested a review from schlessera October 17, 2021 22:00
@jrfnl jrfnl force-pushed the feature/chunkedencodingtest-improvements branch from c268d79 to cd96ff9 Compare October 17, 2021 22:12
... to mirror the name of the test the data provider belongs with.

Includes removing the `static` keyword as data providers do not need to be `static` (and haven't needed to be for a long time).
* Add keys to the entries in each data set.
Just adding one extra test to document the behaviour when an empty string is passed.

As this is a protected method, I deem stringent input validation unnecessary.
* Verify that `$response` is an instance of the `Response` class before approaching it as such.
* Add the `$message` parameter to all assertions.
Includes adding `@covers` tag.
@jrfnl jrfnl force-pushed the feature/chunkedencodingtest-improvements branch from cd96ff9 to a136a2d Compare October 17, 2021 23:08
@schlessera schlessera merged commit ac4b336 into develop Oct 18, 2021
@schlessera schlessera deleted the feature/chunkedencodingtest-improvements branch October 18, 2021 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants