thedevdojo / voyager

Voyager - The Missing Laravel Admin
https://voyager.devdojo.com
MIT License
11.78k stars 2.67k forks source link

phpunit tests failed: missing `laravel/legacy-factories` #5372

Closed Cyrille37 closed 3 years ago

Cyrille37 commented 3 years ago

Version information

Description

Running phpunit failed because of Missing laravel/legacy-factories.

/voyager$ ./vendor/bin/phpunit

PHPUnit 9.5.5 by Sebastian Bergmann and contributors.
Runtime:       PHP 7.3.28-1+ubuntu20.10.1+deb.sury.org+1
Configuration: /home/.../voyager/phpunit.xml
Warning:       XDEBUG_MODE=coverage or xdebug.mode=coverage has to be set
Warning:       Your XML configuration validates against a deprecated schema.
Suggestion:    Migrate your XML configuration using "--migrate-configuration"!

.........................F.....................................  63 / 129 ( 48%)
.....................................EEE......EEEEEE...EEEEEEEE 126 / 129 ( 97%)
...                                                             129 / 129 (100%)

Time: 01:09.567, Memory: 234.50 MB

There were 17 errors:

Exception: Missing `laravel/legacy-factories` in composer.json. Please refer to <https://github.com/orchestral/testbench/blob/6.x/README.md#using-legacy-factories>

/home/.../voyager/vendor/orchestra/testbench-core/src/Concerns/WithFactories.php:33
/home/.../voyager/vendor/orchestra/testbench-core/src/Concerns/WithFactories.php:19
/home/.../voyager/tests/SearchTest.php:26

2) TCG\Voyager\Tests\SearchTest::testCanSearchByBelongstoRelationship
Exception: Missing `laravel/legacy-factories` in composer.json. Please refer to <https://github.com/orchestral/testbench/blob/6.x/README.md#using-legacy-factories>

... ... ...

ERRORS!
Tests: 129, Assertions: 811, Errors: 17, Failures: 1.

Related issues

emptynick commented 3 years ago

You'll have to install that manually when using Laravel 8. We can not add this into composer.json as it only works with Laravel 8 (and not lower)

https://github.com/the-control-group/voyager/blob/af3498ffc386220a7897c84cfeae36f5fb54ca43/.github/workflows/test.yml#L46-L49

Cyrille37 commented 3 years ago

What's a challenge to be compatible with several Laravel versions ! :-) Thanks & cheers.

MrCrayon commented 3 years ago

It should show up as suggested package after install, not very useful but nothing else we can do.

https://github.com/the-control-group/voyager/blob/af3498ffc386220a7897c84cfeae36f5fb54ca43/composer.json#L57

github-actions[bot] commented 1 year ago

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.