Skip to content

Auth\Basic: improve tests#557

Merged
schlessera merged 4 commits intodevelopfrom
feature/auth-basic-improve-tests
Oct 11, 2021
Merged

Auth\Basic: improve tests#557
schlessera merged 4 commits intodevelopfrom
feature/auth-basic-improve-tests

Conversation

@jrfnl
Copy link
Copy Markdown
Member

@jrfnl jrfnl commented Sep 17, 2021

Auth\BasicTest: move test skipping to helper method

  • Move the (duplicate) test skipping code to a test helper function with a descriptive name.
  • Use a dynamic function call to call the test() method instead of using call_user_func().
  • Make the skip message slightly more descriptive.

Auth\BasicTest: stabilize the tests

  • Remove assumptions from the tests in favour of explicitly verifying those assumptions via assertions.
  • Add $message parameter to each assertion as there are multiple assertions in each test.

Auth\BasicTest: improve test for invalid argument count exception

  • Use a dataprovider with named data sets to test that the exception is thrown in all situations in which it should be thrown.
  • Rename the test method to a more descriptive name for the fact that multiple situations are now being tested.
  • Add documentation to the test method.

Auth\BasicTest: improve docblocks

... and add a class level @covers tag.

Related to #497

@jrfnl jrfnl added this to the 2.0.0 milestone Sep 17, 2021
@jrfnl jrfnl requested a review from schlessera September 17, 2021 21:01
@jrfnl jrfnl force-pushed the feature/auth-basic-improve-tests branch from 37aafac to a8b2ec0 Compare October 4, 2021 22:42
jrfnl added 4 commits October 5, 2021 00:57
* Move the (duplicate) test skipping code to a test helper function with a descriptive name.
* Use a dynamic function call to call the `test()` method instead of using `call_user_func()`.
* Make the skip message slightly more descriptive.
* Remove assumptions from the tests in favour of explicitly verifying those assumptions via assertions.
* Add `$message` parameter to each assertion as there are multiple assertions in each test.
* Use a dataprovider with named data sets to test that the exception is thrown in all situations in which it should be thrown.
* Rename the test method to a more descriptive name for the fact that multiple situations are now being tested.
* Add documentation to the test method.
... and add a class level `@covers` tag.
@jrfnl jrfnl force-pushed the feature/auth-basic-improve-tests branch from a8b2ec0 to dab6295 Compare October 4, 2021 22:57
@schlessera schlessera merged commit d8f058b into develop Oct 11, 2021
@schlessera schlessera deleted the feature/auth-basic-improve-tests branch October 11, 2021 14:15
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.

2 participants