diff --git a/src/FilterTest.php b/src/FilterTest.php index 310111d..4e91f2d 100644 --- a/src/FilterTest.php +++ b/src/FilterTest.php @@ -28,6 +28,13 @@ public function accept():bool $accepted = preg_match($this->filter, $name, $matches); + // This fix the issue when an invalid dataprovider method generate a warning + // See issue https://github.com/Codeception/Codeception/issues/4888 + if($test instanceof \PHPUnit\Framework\WarningTestCase) { + $message = $test->getMessage(); + $accepted = preg_match($this->filter, $message, $matches); + } + if ($accepted && isset($this->filterMax)) { $set = end($matches); $accepted = $set >= $this->filterMin && $set <= $this->filterMax;