Skip to content

Commit 343c01e

Browse files
authored
Merge pull request #443 from PHPCSStandards/passedparams/add-extra-test
PassedParameters: add extra test with missing param midway
2 parents 050d536 + 0d37961 commit 343c01e

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

Tests/Utils/PassedParameters/GetParametersTest.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,6 @@ $result = function_call(
143143
#[AnotherAttribute([1, 2, 3])]
144144
function() { /* do something */}
145145
);
146+
147+
/* testMissingParam */
148+
$result = function_call( $value, /* todo */, $anotherValue); // Parse error, but that's not our concern.

Tests/Utils/PassedParameters/GetParametersTest.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,28 @@ function() { /* do something */}',
620620
],
621621
],
622622
],
623+
624+
'function-call-with-missing-param-midway' => [
625+
'testMarker' => '/* testMissingParam */',
626+
'targetType' => \T_STRING,
627+
'expected' => [
628+
1 => [
629+
'start' => 2,
630+
'end' => 3,
631+
'raw' => '$value',
632+
],
633+
2 => [
634+
'start' => 5,
635+
'end' => 6,
636+
'raw' => '/* todo */',
637+
],
638+
3 => [
639+
'start' => 8,
640+
'end' => 9,
641+
'raw' => '$anotherValue',
642+
],
643+
],
644+
],
623645
];
624646
}
625647

0 commit comments

Comments
 (0)