Skip to content

Commit

Permalink
With 8d485f1, we no longer need to account for additional stack frame…
Browse files Browse the repository at this point in the history
…s from ReflectionMethod::invoke()
  • Loading branch information
sebastianbergmann committed Apr 13, 2024
1 parent a30066c commit c25e347
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/Runner/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,11 +419,6 @@ private function trigger(string $file, bool $filterTrigger): IssueTrigger

$trace = $this->filteredStackTrace($filterTrigger);

// Data Provider methods are called via Reflection
if (!isset($trace[1]['file'])) {
$trace[1] = $trace[0];
}

assert(isset($trace[0]['file']));
assert(isset($trace[1]['file']));

Expand Down Expand Up @@ -504,8 +499,8 @@ private function findDataProviderMethodOnCallStack(): array
}

if ($trace[$frame]['class'] === DataProvider::class) {
// PHPUnit\Metadata\Api\DataProvider::dataProvidedByMethods(), ReflectionMethod::invoke()
$dataProviderFrame = $frame - 2;
// PHPUnit\Metadata\Api\DataProvider::dataProvidedByMethods()
$dataProviderFrame = $frame - 1;

break;
}
Expand Down

0 comments on commit c25e347

Please sign in to comment.