running php phpunit repro.php
with repro.php
<?php
final class repro extends \PHPUnit\Framework\TestCase
{
/**
* @return iterable<string>
*/
public static function dataFile(): iterable
{
yield __DIR__ . '/data/preg-match.php';
yield __DIR__ . '/data/preg-match-all.php';
}
/**
* @dataProvider dataFile
*/
public function testFile(string $file): void
{
self::assertTrue(true);
}
}
I get
$ php phpunit repro.php
PHPUnit 11.4-gba61e62d4 by Sebastian Bergmann and contributors.
Runtime: PHP 8.2.12
Configuration: C:\dvl\Workspace\phpunit\phpunit.xml
There was 1 PHPUnit error:
1) repro::testFile
The data provider specified for repro::testFile is invalid
Data set #0 is invalid
C:\dvl\Workspace\phpunit\src\Metadata\Api\DataProvider.php:80
C:\dvl\Workspace\phpunit\src\Framework\TestBuilder.php:43
C:\dvl\Workspace\phpunit\src\Framework\TestSuite.php:514
C:\dvl\Workspace\phpunit\src\Framework\TestSuite.php:109
C:\dvl\Workspace\phpunit\src\TextUI\Configuration\TestSuiteBuilder.php:121
C:\dvl\Workspace\phpunit\src\TextUI\Configuration\TestSuiteBuilder.php:58
C:\dvl\Workspace\phpunit\src\TextUI\Application.php:412
C:\dvl\Workspace\phpunit\src\TextUI\Application.php:180
C:\dvl\Workspace\phpunit\repro.php:19
--
There was 1 PHPUnit test runner warning:
1) No tests found in class "repro".
I think DX wise I would expect a more meaningful error then
Data set #0 is invalid
maybe something like
Data set #0 is invalid, expected X got Y.
running
php phpunit repro.phpwith
repro.phpI get
I think DX wise I would expect a more meaningful error then
maybe something like