Skip to content

Support for external data providers #44

@localheinz

Description

@localheinz

Data providers can be specified like this:

/**
 * @dataProvider \Ergebnis\License\Test\Util\DataProvider\Text::blankOrEmptyString()
 *
 * @param string $name
 */
public function testFromFileRejectsBlankOrEmptyFileName(string $name): void
{
    $this->expectException(Exception\InvalidFile::class);

    Template::fromFile($name);
}

However, psalm/phpunit-psalm-plugin complains with

ERROR: UndefinedMethod - test/Unit/HolderTest.php:33:21 - Provider method Ergebnis\License\Test\Unit\HolderTest::\Ergebnis\License\Test\Util\DataProvider\Text::blankOrEmptyString() is not defined
    public function testFromStringRejectsBlankOrEmptyValue(string $value): void


ERROR: UndefinedMethod - test/Unit/TemplateTest.php:67:21 - Provider method Ergebnis\License\Test\Unit\TemplateTest::\Ergebnis\License\Test\Util\DataProvider\Text::blankOrEmptyString() is not defined
    public function testFromStringRejectsBlankOrEmptyFileName(string $name): void

Is there a chance this can be supported as well?

For a concrete example, see ergebnis/license#23.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions