Skip to content

Commit 8f2d5d7

Browse files
committed
Generic/[Lower|Upper]CaseConstant: add tests with FQN true/false/null
1 parent eafb5ff commit 8f2d5d7

File tree

6 files changed

+43
-21
lines changed

6 files changed

+43
-21
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,7 @@ class TypedConstants {
151151

152152
// Global constants can not be typed.
153153
const MYCONST = TRUE;
154+
155+
$a = \NULL;
156+
$a = \falSe;
157+
$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
@@ -151,3 +151,7 @@ class TypedConstants {
151151

152152
// Global constants can not be typed.
153153
const MYCONST = true;
154+
155+
$a = \null;
156+
$a = \false;
157+
$a = \true;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ public function getErrorList($testFile='')
6666
129 => 1,
6767
149 => 1,
6868
153 => 1,
69+
155 => 1,
70+
156 => 1,
71+
157 => 1,
6972
];
7073

7174
case 'LowerCaseConstantUnitTest.js':

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,7 @@ class TypedThings {
9696
}
9797

9898
$cl = function (int|false $param = null, Type|null $obj = new MyObj(false)) : string|false|null {};
99+
100+
$a = \null;
101+
$a = \falSe;
102+
$a = \True;

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,7 @@ class TypedThings {
9696
}
9797

9898
$cl = function (int|false $param = NULL, Type|null $obj = new MyObj(FALSE)) : string|false|null {};
99+
100+
$a = \NULL;
101+
$a = \FALSE;
102+
$a = \TRUE;

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

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,30 @@ final class UpperCaseConstantUnitTest extends AbstractSniffUnitTest
3131
public function getErrorList()
3232
{
3333
return [
34-
7 => 1,
35-
10 => 1,
36-
15 => 1,
37-
16 => 1,
38-
23 => 1,
39-
26 => 1,
40-
31 => 1,
41-
32 => 1,
42-
39 => 1,
43-
42 => 1,
44-
47 => 1,
45-
48 => 1,
46-
70 => 1,
47-
71 => 1,
48-
85 => 1,
49-
87 => 1,
50-
88 => 1,
51-
90 => 2,
52-
92 => 2,
53-
93 => 1,
54-
98 => 2,
34+
7 => 1,
35+
10 => 1,
36+
15 => 1,
37+
16 => 1,
38+
23 => 1,
39+
26 => 1,
40+
31 => 1,
41+
32 => 1,
42+
39 => 1,
43+
42 => 1,
44+
47 => 1,
45+
48 => 1,
46+
70 => 1,
47+
71 => 1,
48+
85 => 1,
49+
87 => 1,
50+
88 => 1,
51+
90 => 2,
52+
92 => 2,
53+
93 => 1,
54+
98 => 2,
55+
100 => 1,
56+
101 => 1,
57+
102 => 1,
5558
];
5659

5760
}//end getErrorList()

0 commit comments

Comments
 (0)