Skip to content

Commit b33c2df

Browse files
committed
Generic/[Lower|Upper]CaseConstant: add tests with FQN true/false/null
These are the only two sniffs explicitly targetting `true`, `false` and `null`. This commit adds some tests to safeguard these sniffs function correctly on "fully qualified true/false/null".
1 parent cdac3b1 commit b33c2df

6 files changed

+22
-0
lines changed

src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,3 +177,7 @@ abstract class SkipOverPHP84AbstractProperties {
177177
abstract MyType|TRUE $propA {get;}
178178
protected abstract NULL|MyClass $propB {set;}
179179
}
180+
181+
$a = \NULL;
182+
$a = \falSe;
183+
$a = \True;

src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc.fixed

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,3 +177,7 @@ abstract class SkipOverPHP84AbstractProperties {
177177
abstract MyType|TRUE $propA {get;}
178178
protected abstract NULL|MyClass $propB {set;}
179179
}
180+
181+
$a = \null;
182+
$a = \false;
183+
$a = \true;

src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ public function getErrorList($testFile='')
7070
169 => 1,
7171
171 => 1,
7272
173 => 1,
73+
181 => 1,
74+
182 => 1,
75+
183 => 1,
7376
];
7477

7578
case 'LowerCaseConstantUnitTest.js':

src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,7 @@ abstract class SkipOverPHP84AbstractProperties {
118118
abstract MyType|true $propA {get;}
119119
protected abstract null|MyClass $propB {set;}
120120
}
121+
122+
$a = \null;
123+
$a = \falSe;
124+
$a = \True;

src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc.fixed

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,7 @@ abstract class SkipOverPHP84AbstractProperties {
118118
abstract MyType|true $propA {get;}
119119
protected abstract null|MyClass $propB {set;}
120120
}
121+
122+
$a = \NULL;
123+
$a = \FALSE;
124+
$a = \TRUE;

src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ public function getErrorList()
5555
112 => 1,
5656
113 => 1,
5757
114 => 1,
58+
122 => 1,
59+
123 => 1,
60+
124 => 1,
5861
];
5962

6063
}//end getErrorList()

0 commit comments

Comments
 (0)