Skip to content

Commit bba4942

Browse files
jrfnlgsherwood
authored andcommitted
PHP 8.0 | Generic/ScopeIndent: add tests with match control structure
1 parent 85725e5 commit bba4942

File tree

5 files changed

+114
-2
lines changed

5 files changed

+114
-2
lines changed

src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,6 +1476,33 @@ class Foo
14761476
}
14771477
}
14781478

1479+
$value = match ($value) {
1480+
'' => null,
1481+
false => false,
1482+
1, 2, 3 => true,
1483+
default => $value,
1484+
};
1485+
1486+
$value = match ($value) {
1487+
'' => null,
1488+
false => false,
1489+
1, 2, 3 => true,
1490+
default => $value,
1491+
};
1492+
1493+
$value = match (
1494+
$value
1495+
) {
1496+
'' => null,
1497+
false
1498+
=> false,
1499+
1,
1500+
2,
1501+
3 => true,
1502+
default =>
1503+
$value,
1504+
};
1505+
14791506
/* ADD NEW TESTS ABOVE THIS LINE AND MAKE SURE THAT THE 1 (space-based) AND 2 (tab-based) FILES ARE IN SYNC! */
14801507
?>
14811508

src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc.fixed

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,6 +1476,33 @@ class Foo
14761476
}
14771477
}
14781478

1479+
$value = match ($value) {
1480+
'' => null,
1481+
false => false,
1482+
1, 2, 3 => true,
1483+
default => $value,
1484+
};
1485+
1486+
$value = match ($value) {
1487+
'' => null,
1488+
false => false,
1489+
1, 2, 3 => true,
1490+
default => $value,
1491+
};
1492+
1493+
$value = match (
1494+
$value
1495+
) {
1496+
'' => null,
1497+
false
1498+
=> false,
1499+
1,
1500+
2,
1501+
3 => true,
1502+
default =>
1503+
$value,
1504+
};
1505+
14791506
/* ADD NEW TESTS ABOVE THIS LINE AND MAKE SURE THAT THE 1 (space-based) AND 2 (tab-based) FILES ARE IN SYNC! */
14801507
?>
14811508

src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,6 +1476,33 @@ class Foo
14761476
}
14771477
}
14781478

1479+
$value = match ($value) {
1480+
'' => null,
1481+
false => false,
1482+
1, 2, 3 => true,
1483+
default => $value,
1484+
};
1485+
1486+
$value = match ($value) {
1487+
'' => null,
1488+
false => false,
1489+
1, 2, 3 => true,
1490+
default => $value,
1491+
};
1492+
1493+
$value = match (
1494+
$value
1495+
) {
1496+
'' => null,
1497+
false
1498+
=> false,
1499+
1,
1500+
2,
1501+
3 => true,
1502+
default =>
1503+
$value,
1504+
};
1505+
14791506
/* ADD NEW TESTS ABOVE THIS LINE AND MAKE SURE THAT THE 1 (space-based) AND 2 (tab-based) FILES ARE IN SYNC! */
14801507
?>
14811508

src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc.fixed

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,6 +1476,33 @@ class Foo
14761476
}
14771477
}
14781478

1479+
$value = match ($value) {
1480+
'' => null,
1481+
false => false,
1482+
1, 2, 3 => true,
1483+
default => $value,
1484+
};
1485+
1486+
$value = match ($value) {
1487+
'' => null,
1488+
false => false,
1489+
1, 2, 3 => true,
1490+
default => $value,
1491+
};
1492+
1493+
$value = match (
1494+
$value
1495+
) {
1496+
'' => null,
1497+
false
1498+
=> false,
1499+
1,
1500+
2,
1501+
3 => true,
1502+
default =>
1503+
$value,
1504+
};
1505+
14791506
/* ADD NEW TESTS ABOVE THIS LINE AND MAKE SURE THAT THE 1 (space-based) AND 2 (tab-based) FILES ARE IN SYNC! */
14801507
?>
14811508

src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,14 @@ public function getErrorList($testFile='ScopeIndentUnitTest.inc')
151151
1340 => 1,
152152
1342 => 1,
153153
1345 => 1,
154-
1487 => 1,
155154
1488 => 1,
156155
1489 => 1,
157-
1490 => 1,
156+
1500 => 1,
157+
1503 => 1,
158+
1514 => 1,
159+
1515 => 1,
160+
1516 => 1,
161+
1517 => 1,
158162
];
159163

160164
}//end getErrorList()

0 commit comments

Comments
 (0)