vasilukwolf's avatar

Class and method don't have connect in test folder

Last time I'm working https://laracasts.com/series/build-a-laravel-app-with-tdd 17, and I have trouble with connecting the class or method

https://github.com/vasilukwolf/TDDLaravelApp/runs/333732102

Run vendor/bin/phpunit
PHPUnit 8.4.3 by Sebastian Bergmann and contributors.

................E...                                              20 / 20 (100%)

Time: 981 ms, Memory: 32.00 MB

There was 1 error:

1) Tests\Feature\ProjectTasksTest::a_project_can_be_updated
Error: Call to undefined method Facades\Tests\Setup\ProjectFactory::withTasks()

/home/runner/work/TDDLaravelApp/TDDLaravelApp/tests/Feature/ProjectTasksTest.php:36

ERRORS!
Tests: 20, Assertions: 40, Errors: 1.
##[error]Process completed with exit code 2.

https://github.com/vasilukwolf/TDDLaravelApp/commit/81349cb4178304d5808ca4df9dbeb902dd603cfa#diff-16edfe6ef3a1dd70044bcdd75403769a

Try composer self-update. How to connect the class in the test?

https://github.com/vasilukwolf/TDDLaravelApp/issues/5

0 likes
1 reply
bugsysha's avatar
bugsysha
Best Answer
Level 61

Replace use Facades\Tests\Setup\ProjectFactory; with use Tests\Setup\ProjectFactory; and see if it works.

2 likes

Please or to participate in this conversation.