Skip to content

Conversation

@jrfnl
Copy link
Member

@jrfnl jrfnl commented Sep 17, 2021

HeadersTest: rearrange the method order in the test class

... grouping tests related to array access together.

HeadersTest: rename a test to be more descriptive

HeadersTest: refactor array access tests

  • Merge two tests doing the exact same thing, into one test using a data provider with named data sets.
  • Add docblock documentation to the test and the data provider.

HeadersTest::testIteration(): various minor tweaks

  • Add $message parameter to each assertion as there are multiple assertions in the test.
  • Make the exception more descriptive (not that I expect it to ever be thrown).
  • Add a docblock to the test.
  • Remove the @depends annotation which doesn't make any sense here.

HeadersTest::testIteration(): safeguard the flattening

The Header::getIterator() method uses the Header::flatten() method, but there was no test safeguarding this functionality against regressions.

Fixed now by adding an additional check to the HeadersTest::testIteration() method.

HeadersTest: add extra test for offsetGet()

.. for functionality previously not covered by a test.

HeadersTest: add test for getValues()

... which was, so far, not covered by tests yet.

HeadersTest: add docblocks to the rest of the tests

HeadersTest: add @Covers tags

Related to #497

... grouping tests related to array access together.
* Merge two tests doing the exact same thing, into one test using a data provider with named data sets.
* Add docblock documentation to the test and the data provider.
* Add `$message` parameter to each assertion as there are multiple assertions in the test.
* Make the exception more descriptive (not that I expect it to ever be thrown).
* Add a docblock to the test.
* Remove the `@depends` annotation which doesn't make any sense here.
The `Header::getIterator()` method uses the `Header::flatten()` method, but there was no test safeguarding this functionality against regressions.

Fixed now by adding an additional check to the `HeadersTest::testIteration()` method.
.. for functionality previously not covered by a test.
... which was, so far, not covered by tests yet.
@jrfnl jrfnl added this to the 2.0.0 milestone Sep 17, 2021
@jrfnl jrfnl requested a review from schlessera September 17, 2021 12:47
@schlessera schlessera merged commit 28f5ab6 into develop Sep 23, 2021
@schlessera schlessera deleted the feature/responseheader-improve-tests branch September 23, 2021 09:05
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.

3 participants