Skip to content

Commit 4a0c674

Browse files
committed
ProcessRulesetCliArgsTest: allow for the tests to pass in CBF mode
1 parent fe1e5d3 commit 4a0c674

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

tests/Core/Ruleset/ProcessRulesetCliArgsTest.php

+14-8
Original file line numberDiff line numberDiff line change
@@ -184,27 +184,33 @@ public function testCliArgsWithPaths($name, $expected)
184184
*/
185185
public static function dataCliArgsWithPaths()
186186
{
187-
return [
188-
'Paths should be resolved based on the ruleset location: basepath' => [
187+
$data = [
188+
'Paths should be resolved based on the ruleset location: basepath' => [
189189
'name' => 'basepath',
190190
'expected' => self::FIXTURE_DIR,
191191
],
192-
'Paths should be resolved based on the ruleset location: reportFile' => [
193-
'name' => 'reportFile',
194-
'expected' => self::FIXTURE_DIR.'/config/phpcs/report.txt',
195-
],
196-
'Paths should be resolved based on the ruleset location: bootstrap' => [
192+
'Paths should be resolved based on the ruleset location: bootstrap' => [
197193
'name' => 'bootstrap',
198194
'expected' => [
199195
self::FIXTURE_DIR.'/vendor/OrgName/ExtStandard/bootstrap.php',
200196
],
201197
],
202-
'Paths should be resolved based on the ruleset location: cacheFile' => [
198+
'Paths should be resolved based on the ruleset location: cacheFile' => [
203199
'name' => 'cacheFile',
204200
'expected' => self::FIXTURE_DIR.'/config/phpcs/.cache.phpcs',
205201
],
206202
];
207203

204+
// Setting the `--report-file=` arg is only supported when running `phpcs`.
205+
if (PHP_CODESNIFFER_CBF === false) {
206+
$data['Paths should be resolved based on the ruleset location: reportFile'] = [
207+
'name' => 'reportFile',
208+
'expected' => self::FIXTURE_DIR.'/config/phpcs/report.txt',
209+
];
210+
}
211+
212+
return $data;
213+
208214
}//end dataCliArgsWithPaths()
209215

210216

0 commit comments

Comments
 (0)