@@ -472,9 +472,11 @@ public function restoreDefaults()
472
472
$ this ->colors = (bool ) $ colors ;
473
473
}
474
474
475
- $ cache = self ::getConfigData ('cache ' );
476
- if ($ cache !== null ) {
477
- $ this ->cache = (bool ) $ cache ;
475
+ if (defined ('PHP_CODESNIFFER_IN_TESTS ' ) === false ) {
476
+ $ cache = self ::getConfigData ('cache ' );
477
+ if ($ cache !== null ) {
478
+ $ this ->cache = (bool ) $ cache ;
479
+ }
478
480
}
479
481
480
482
}//end restoreDefaults()
@@ -534,12 +536,16 @@ public function processShortArgument($arg, $pos)
534
536
}
535
537
break ;
536
538
case 'n ' :
537
- $ this ->warningSeverity = 0 ;
538
- $ this ->overriddenDefaults ['warningSeverity ' ] = true ;
539
+ if (isset ($ this ->overriddenDefaults ['warningSeverity ' ]) === false ) {
540
+ $ this ->warningSeverity = 0 ;
541
+ $ this ->overriddenDefaults ['warningSeverity ' ] = true ;
542
+ }
539
543
break ;
540
544
case 'w ' :
541
- $ this ->warningSeverity = $ this ->errorSeverity ;
542
- $ this ->overriddenDefaults ['warningSeverity ' ] = true ;
545
+ if (isset ($ this ->overriddenDefaults ['warningSeverity ' ]) === false ) {
546
+ $ this ->warningSeverity = $ this ->errorSeverity ;
547
+ $ this ->overriddenDefaults ['warningSeverity ' ] = true ;
548
+ }
543
549
break ;
544
550
default :
545
551
if ($ this ->dieOnUnknownArg === false ) {
@@ -579,8 +585,10 @@ public function processLongArgument($arg, $pos)
579
585
$ this ->overriddenDefaults ['colors ' ] = true ;
580
586
break ;
581
587
case 'cache ' :
582
- $ this ->cache = true ;
583
- $ this ->overriddenDefaults ['cache ' ] = true ;
588
+ if (defined ('PHP_CODESNIFFER_IN_TESTS ' ) === false ) {
589
+ $ this ->cache = true ;
590
+ $ this ->overriddenDefaults ['cache ' ] = true ;
591
+ }
584
592
break ;
585
593
case 'no-cache ' :
586
594
$ this ->cache = false ;
0 commit comments