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

Auth\Basic: improve tests #557

Merged
merged 4 commits into from
Oct 11, 2021
Merged

Conversation

jrfnl
Copy link
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 force-pushed the feature/auth-basic-improve-tests branch from 37aafac to a8b2ec0 Compare October 4, 2021 22:42
* 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