Skip to content

Commit 7030f03

Browse files
rodrigoprimojrfnl
authored andcommitted
Generic/CallTimePassByReference: improve test coverage
1 parent 39b8764 commit 7030f03

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

src/Standards/Generic/Tests/Functions/CallTimePassByReferenceUnitTest.1.inc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,15 @@ myfunc(MY_CONST&$myvar);
3737

3838
efg( true == &$b );
3939
efg( true === &$b );
40+
41+
foo($a, bar(&$b));
42+
foo($a, array(&$b));
43+
44+
enum Foo {}
45+
interface Foo {}
46+
trait Foo {}
47+
48+
$instance = new $var($a);
49+
$instance = new MyClass($a);
50+
$instance = new $var(&$a);
51+
$instance = new MyClass(&$a);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
// Intentional parse error (missing closing parenthesis).
4+
// This should be the only test in this file.
5+
// Testing that the sniff is *not* triggered.
6+
7+
foo(

src/Standards/Generic/Tests/Functions/CallTimePassByReferenceUnitTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ public function getErrorList($testFile='CallTimePassByReferenceUnitTest.1.inc')
4141
18 => 2,
4242
23 => 1,
4343
30 => 1,
44+
41 => 1,
45+
50 => 1,
46+
51 => 1,
4447
];
4548

4649
default:

0 commit comments

Comments
 (0)