mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-23 19:39:10 -04:00
ALPHA 3.0.2a
This commit is contained in:
@@ -26,7 +26,7 @@ class ListPassTest extends CodeCleanerTestCase
|
||||
*/
|
||||
public function testProcessInvalidStatement($code, $expectedMessage)
|
||||
{
|
||||
if (method_exists($this, 'setExpectedException')) {
|
||||
if (\method_exists($this, 'setExpectedException')) {
|
||||
$this->setExpectedException('Psy\Exception\ParseErrorException', $expectedMessage);
|
||||
} else {
|
||||
$this->expectExceptionMessage($expectedMessage);
|
||||
@@ -50,20 +50,23 @@ class ListPassTest extends CodeCleanerTestCase
|
||||
['list("a") = array(1)', $errorPhpParserSyntax],
|
||||
];
|
||||
|
||||
if (version_compare(PHP_VERSION, '7.1', '<')) {
|
||||
return array_merge($invalidExpr, [
|
||||
if (\version_compare(PHP_VERSION, '7.1', '<')) {
|
||||
return \array_merge($invalidExpr, [
|
||||
['list("a" => _) = array("a" => 1)', $errorPhpParserSyntax],
|
||||
['[] = []', $errorShortListAssign],
|
||||
['[$a] = [1]', $errorShortListAssign],
|
||||
['list("a" => $a) = array("a" => 1)', $errorAssocListAssign],
|
||||
['[$a[0], $a[1]] = [1, 2]', $errorShortListAssign],
|
||||
['[$a->b, $a->c] = [1, 2]', $errorShortListAssign],
|
||||
]);
|
||||
}
|
||||
|
||||
return array_merge($invalidExpr, [
|
||||
return \array_merge($invalidExpr, [
|
||||
['list("a" => _) = array("a" => 1)', $errorPhpParserSyntax],
|
||||
['["a"] = [1]', $errorNonVariableAssign],
|
||||
['[] = []', $errorEmptyList],
|
||||
['[,] = [1,2]', $errorEmptyList],
|
||||
['[,,] = [1,2,3]', $errorEmptyList],
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -84,8 +87,8 @@ class ListPassTest extends CodeCleanerTestCase
|
||||
['list($x, $y) = array(1, 2)'],
|
||||
];
|
||||
|
||||
if (version_compare(PHP_VERSION, '7.1', '>=')) {
|
||||
return array_merge($validExpr, [
|
||||
if (\version_compare(PHP_VERSION, '7.1', '>=')) {
|
||||
return \array_merge($validExpr, [
|
||||
['[$a] = array(1)'],
|
||||
['list($b) = [2]'],
|
||||
['[$x, $y] = array(1, 2)'],
|
||||
@@ -96,6 +99,8 @@ class ListPassTest extends CodeCleanerTestCase
|
||||
['[,$b] = [1,2,3]'],
|
||||
['[$a,,$c] = [1,2,3]'],
|
||||
['[$a,,,] = [1,2,3]'],
|
||||
['[$a[0], $a[1]] = [1, 2]'],
|
||||
['[$a->b, $a->c] = [1, 2]'],
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user