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

RegisterExternalStandardsTest: add new tests #165

Merged
merged 3 commits into from Mar 5, 2022

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Mar 5, 2022

Proposed Changes

TestCase: introduce new configShowToPathsArray() method

... as a helper to allow for comparing expected and actual registered paths from --config-show.

RegisterExternalStandardsTest: add test registering one standard with multiple rulesets

  • As the behaviour shouldn't be different between Composer local/global, the test is only run against one of these (local).
  • The test is, however, run against multiple PHPCS versions to ensure the path to the standard as registered allows for picking up all expected rulesets in all supported PHPCS versions.

Includes adding a fake standard with multiple rulesets as a fixture for this test.

RegisterExternalStandardsTest: add test registering standard with ruleset in nested dir

  • As the behaviour shouldn't be different between Composer local/global, the test is only run against one of these (global).
  • The test is run against one random PHPCS version as with the other tests in place, sufficient PHPCS versions are being tested.
    Even though this means there is only one test case, I've elected to still use a data provider to ensure that failing tests will mention the PHPCS version in the test name, which should help with debugging.

Includes adding a fake standard as a fixture for this test.

Related to #92

... as a helper to allow for comparing expected and actual registered paths from `--config-show`.
… multiple rulesets

* As the behaviour shouldn't be different between Composer local/global, the test is only run against one of these (local).
* The test is, however, run against multiple PHPCS versions to ensure the path to the standard as registered allows for picking up all expected rulesets in all supported PHPCS versions.

Includes adding a fake standard with multiple rulesets as a fixture for this test.
…eset in nested dir

* As the behaviour shouldn't be different between Composer local/global, the test is only run against one of these (global).
* The test is run against one random PHPCS version as with the other tests in place, sufficient PHPCS versions are being tested.
    Even though this means there is only _one_ test case, I've elected to still use a data provider to ensure that failing tests will mention the PHPCS version in the test name, which should help with debugging.

Includes adding a fake standard as a fixture for this test.
@Potherca Potherca enabled auto-merge March 5, 2022 13:29
@jrfnl jrfnl changed the title Feature/registerexternalstnds add new tests RegisterExternalStandardsTest: add new tests Mar 5, 2022
@Potherca Potherca merged commit 56d537d into master Mar 5, 2022
@Potherca Potherca deleted the feature/registerexternalstnds-add-new-tests branch March 5, 2022 14:34
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