Skip to content

ProcessRulesetCliArgsTest: add tests for cache arg #1069

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

<!-- Issue squizlabs/PHP_CodeSniffer#2395: allow overruling CLI args when they have different CLI flag names. -->
<arg name="no-colors"/>
<arg name="cache" value="./config/phpcs/.cache.phpcs"/>

<!-- Miscellaneous other settings. -->
<arg name="report" value="full,summary,source"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
<arg name="extensions" value="inc,php"/>
<arg name="tab-width" value="4"/>

<!-- Issue squizlabs/PHP_CodeSniffer#2395: second test. -->
<arg name="no-cache"/>

<!-- Miscellaneous other settings. -->
<arg name="report-width" value="120"/>

Expand Down
8 changes: 8 additions & 0 deletions tests/Core/Ruleset/ProcessRulesetCliArgsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ public static function dataCliArgs()
'name' => 'warningSeverity',
'expected' => 5,
],
'Issue squiz#2395: "cache" set to file in parent before includes; "no-cache" set in child; parent should win [1]' => [
'name' => 'cache',
'expected' => true,
],
'Issue squiz#2395: "q" in child A before includes; "p" set in grandchild A, child A should win' => [
'name' => 'showProgress',
'expected' => false,
Expand Down Expand Up @@ -195,6 +199,10 @@ public static function dataCliArgsWithPaths()
self::FIXTURE_DIR.'/vendor/OrgName/ExtStandard/bootstrap.php',
],
],
'Paths should be resolved based on the ruleset location: cacheFile' => [
'name' => 'cacheFile',
'expected' => self::FIXTURE_DIR.'/config/phpcs/.cache.phpcs',
],
];

}//end dataCliArgsWithPaths()
Expand Down