Skip to content

Fix data provider in FixturesTest #283

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

donquixote
Copy link

For newer versions of phpunit, data provider methods should be public.

Also, the value keys in data provider records should match parameter names, OR they should simply be parameter lists instead of associative arrays.

Steps to reproduce:

./vendor/bin/phpunit tests/Util/FixturesTest.php --display-all-issues --stop-on-deprecation

We get

1) BigBlueButton\Util\FixturesTest::testStructureOfFixturesIsStillUpToDate
* Data Provider method BigBlueButton\Util\FixturesTest::xmlFileToFunctionMapping() is not public

* Data Provider method BigBlueButton\Util\FixturesTest::xmlFileToFunctionMapping() is not static

/****/tests/Util/FixturesTest.php:114

and multiple of these:

2) BigBlueButton\Util\FixturesTest::testStructureOfFixturesIsStillUpToDate with data set "case01_api_version" ('getApiVersion', 'api_version.xml', true, '', null)
Providing invalid named argument $function for method BigBlueButton\Util\FixturesTest::testStructureOfFixturesIsStillUpToDate() is deprecated and will not be supported in PHPUnit 11.0..

/****/tests/Util/FixturesTest.php:114

@@ -111,14 +111,14 @@ public function testCoverageOfFixtures(): void
*
* @dataProvider xmlFileToFunctionMapping
*/
public function testStructureOfFixturesIsStillUpToDate(string $requestFunction, string $filename, bool $success, string $messageKey, ?\Closure $parameters): void
public function testStructureOfFixturesIsStillUpToDate(string $method, string $filename, bool $success, string $messageKey, ?\Closure $parameters): void
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think $method is more suitable than $function or $requestFunction, because it is, in fact, a method and not a function.

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

Successfully merging this pull request may close these issues.

1 participant