@@ -16,8 +16,9 @@ public function testAnalyzeFunctionSimple(): void
16
16
$ func ->addVariable (new VarReference ('a ' , 2 ));
17
17
$ func ->addVariable (new VarReference ('a ' , 3 ));
18
18
19
- $ sut = new VariableAnalyzer ([$ func ]);
19
+ $ sut = new VariableAnalyzer (' target.php ' , [$ func ]);
20
20
$ result = $ sut ->analyze ();
21
+ $ this ->assertSame ('target.php ' , $ result ->filename );
21
22
$ scopes = $ result ->scopes ;
22
23
23
24
$ this ->assertCount (1 , $ scopes );
@@ -32,8 +33,9 @@ public function testAnalyzeFunctionLong(): void
32
33
$ func ->addVariable (new VarReference ('a ' , 2 ));
33
34
$ func ->addVariable (new VarReference ('a ' , 100 ));
34
35
35
- $ sut = new VariableAnalyzer ([$ func ]);
36
+ $ sut = new VariableAnalyzer (' target.php ' , [$ func ]);
36
37
$ result = $ sut ->analyze ();
38
+ $ this ->assertSame ('target.php ' , $ result ->filename );
37
39
$ scopes = $ result ->scopes ;
38
40
39
41
$ this ->assertCount (1 , $ scopes );
@@ -48,8 +50,9 @@ public function testAnalyzeFunctionLongAssignedVariable(): void
48
50
$ func ->addVariable (new VarReference ('a ' , 2 ));
49
51
$ func ->addVariable (new VarReference ('a ' , 100 ));
50
52
51
- $ sut = new VariableAnalyzer ([$ func ]);
53
+ $ sut = new VariableAnalyzer (' target.php ' , [$ func ]);
52
54
$ result = $ sut ->analyze ();
55
+ $ this ->assertSame ('target.php ' , $ result ->filename );
53
56
$ scopes = $ result ->scopes ;
54
57
55
58
$ this ->assertCount (1 , $ scopes );
@@ -64,8 +67,9 @@ public function testAnalyzeFunctionLongMultipleAssignedVariable(): void
64
67
$ func ->addVariable (new VarReference ('a ' , 2 ));
65
68
$ func ->addVariable (new VarReference ('a ' , 100 , true ));
66
69
67
- $ sut = new VariableAnalyzer ([$ func ]);
70
+ $ sut = new VariableAnalyzer (' target.php ' , [$ func ]);
68
71
$ result = $ sut ->analyze ();
72
+ $ this ->assertSame ('target.php ' , $ result ->filename );
69
73
$ scopes = $ result ->scopes ;
70
74
71
75
$ this ->assertCount (1 , $ scopes );
0 commit comments