Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for external data providers #44

Closed
localheinz opened this issue Jan 9, 2020 · 1 comment · Fixed by #45
Closed

Support for external data providers #44

localheinz opened this issue Jan 9, 2020 · 1 comment · Fixed by #45
Assignees
Labels
enhancement New feature or request

Comments

@localheinz
Copy link

localheinz commented Jan 9, 2020

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.

@weirdan weirdan self-assigned this Jan 9, 2020
@weirdan weirdan added the enhancement New feature or request label Jan 9, 2020
weirdan added a commit to weirdan/phpunit-psalm-plugin that referenced this issue Jan 10, 2020
@weirdan
Copy link
Member

weirdan commented Jan 10, 2020

Released in 0.8.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants