Skip to content

Cookie\UriMatchesTest: improve and stabilize - #737

Merged
schlessera merged 6 commits into
developfrom
feature/497-cookie-urimatches-test-improve-and-stabilize
Jun 20, 2022
Merged

Cookie\UriMatchesTest: improve and stabilize#737
schlessera merged 6 commits into
developfrom
feature/497-cookie-urimatches-test-improve-and-stabilize

Conversation

@jrfnl

@jrfnl jrfnl commented May 10, 2022

Copy link
Copy Markdown
Member

TestCase: add helper function to create a data provider from a simple array

Helper function to convert a simple, single-level text array to a data provider with named test cases, where the value of the test case is the same as the name of the test case.

Includes adding an exception to the PHPCS ruleset for test code.

Cookie\UriMatchesTest::testUrlMatch*(): use named data provider

This commit:

  • Adds descriptive names to each of the cases being tested via the data provider.
  • Adds keys to the parameters passed for each test case to make it easier to understand the test case.
  • Improves the inline documentation in the data provider.

Cookie\UriMatchesTest::testUrlMatch*(): minor documentation and readability improvements

Cookie\UriMatchesTest::testUrlMatchSecure(): improve test

Refactor the test to use a data provider and cover all possible situations.

Includes:

  • Adding the $message parameter to assertions.
  • Adding a docblock to the test.

Cookie\UriMatchesTest::testUrlMatchManuallySet(): refactor to data provider

Cookie\UriMatchesTest::testUrlMatchManuallySet(): add extra test case

Related to #497

@jrfnl jrfnl added this to the 2.1.0 milestone May 10, 2022
@jrfnl
jrfnl requested a review from schlessera May 10, 2022 22:43
jrfnl added 6 commits May 11, 2022 01:01
… array

Helper function to convert a simple, single-level text array to a data provider with named test cases, where the value of the test case is the same as the name of the test case.

Includes adding an exception to the PHPCS ruleset for test code.
This commit:
* Adds descriptive names to each of the cases being tested via the data provider.
* Adds keys to the parameters passed for each test case to make it easier to understand the test case.
* Improves the inline documentation in the data provider.
Refactor the test to use a data provider and cover all possible situations.

Includes:
* Adding the `$message` parameter to assertions.
* Adding a docblock to the test.
@jrfnl
jrfnl force-pushed the feature/497-cookie-urimatches-test-improve-and-stabilize branch from 80968ff to 937a0b6 Compare May 10, 2022 23:02
@schlessera
schlessera merged commit fc36dd6 into develop Jun 20, 2022
@schlessera
schlessera deleted the feature/497-cookie-urimatches-test-improve-and-stabilize branch June 20, 2022 10:07
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