Skip to content

Commit 9ccc62d

Browse files
committed
Add a bare variable test for consistency with the other similar helper method tests
1 parent 340247b commit 9ccc62d

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

WordPress/Tests/Helpers/ContextHelper/IsInArrayComparisonUnitTest.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* The below should NOT be recognized as being inside an array comparison function call.
55
*/
66

7+
/* testBareVariable */ $value;
78
some_function( /* testOtherFunctionCall */ $value );
89
MyNamespace\in_array( /* testPartiallyQualifiedFunction */ $value, $haystack );
910
\MyNamespace\array_search( /* testFullyQualifiedNamespacedFunction */ $value, $haystack );

WordPress/Tests/Helpers/ContextHelper/IsInArrayComparisonUnitTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ public function testIsInArrayComparison( $testMarker, $expectedResult ) {
4848
public static function dataIsInArrayComparison() {
4949
return array(
5050
// Cases that should return false.
51+
'bare_variable' => array(
52+
'testMarker' => '/* testBareVariable */',
53+
'expectedResult' => false,
54+
),
5155
'other_function_call' => array(
5256
'testMarker' => '/* testOtherFunctionCall */',
5357
'expectedResult' => false,

0 commit comments

Comments
 (0)