File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -566,6 +566,8 @@ private function getLinesToBeIgnoredInner(string $fileName): array
566566 case PHP_Token_INTERFACE::class:
567567 case PHP_Token_TRAIT::class:
568568 case PHP_Token_CLASS::class:
569+ $ this ->ignoredLines [$ fileName ][] = $ token ->getLine (); //work around https://bugs.xdebug.org/view.php?id=1798
570+ // Intentional fallthrough
569571 case PHP_Token_FUNCTION::class:
570572 /* @var \PHP_Token_Interface $token */
571573
Original file line number Diff line number Diff line change @@ -156,11 +156,11 @@ public function testNotCrashParsing(): void
156156 $ expectedPath = rtrim (TEST_FILES_PATH , DIRECTORY_SEPARATOR );
157157 $ this ->assertEquals ($ expectedPath , $ root ->name ());
158158 $ this ->assertEquals ($ expectedPath , $ root ->pathAsString ());
159- $ this ->assertEquals (2 , $ root ->numberOfExecutableLines ());
159+ $ this ->assertEquals (1 , $ root ->numberOfExecutableLines ());
160160 $ this ->assertEquals (0 , $ root ->numberOfExecutedLines ());
161161 $ data = $ coverage ->getData ()->lineCoverage ();
162162 $ expectedFile = $ expectedPath . DIRECTORY_SEPARATOR . 'Crash.php ' ;
163- $ this ->assertSame ([$ expectedFile => [1 => [], 2 => [] ]], $ data );
163+ $ this ->assertSame ([$ expectedFile => [1 => []]], $ data );
164164 }
165165
166166 public function testBuildDirectoryStructure (): void
Original file line number Diff line number Diff line change @@ -143,10 +143,12 @@ public function testGetLinesToBeIgnored(): void
143143 14 ,
144144 15 ,
145145 16 ,
146+ 18 ,
146147 23 ,
147148 24 ,
148149 25 ,
149150 30 ,
151+ 33 ,
150152 ],
151153 $ this ->getLinesToBeIgnored ()->invoke (
152154 $ this ->coverage ,
@@ -169,7 +171,9 @@ public function testGetLinesToBeIgnored2(): void
169171 public function testGetLinesToBeIgnored3 (): void
170172 {
171173 $ this ->assertEquals (
172- [],
174+ [
175+ 3 ,
176+ ],
173177 $ this ->getLinesToBeIgnored ()->invoke (
174178 $ this ->coverage ,
175179 TEST_FILES_PATH . 'source_with_class_and_anonymous_function.php '
@@ -181,6 +185,8 @@ public function testGetLinesToBeIgnoredOneLineAnnotations(): void
181185 {
182186 $ this ->assertEquals (
183187 [
188+ 4 ,
189+ 9 ,
184190 29 ,
185191 31 ,
186192 32 ,
You can’t perform that action at this time.
0 commit comments