Summer Sale! All accounts are 50% off this week.

Snapey's avatar
Level 122

Function ReflectionType::__toString() is deprecated

I'm working on a Laravel 7.30 project, trying to get tests running, but getting the above reflection error when running a test that uses the RefreshDatabase trait

  • Laravel 7.30.5
  • PHPUnit 8.5.0
  • PHP 7.4

Any suggestions gratefully received!

0 likes
5 replies
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

I had this in a non laravel project. I think updating phpunit to a newer version fixed it. The error was in phpunit and not my code

Snapey's avatar
Level 122

I've just removed phpunit then reinstalled it. Its now at version 9.5 - but the problem remains

1 like
Snapey's avatar
Level 122

Uninstalled mockery and reinstalled and it bumped from 0.9 to 1.4 - all seems ok now !

TxNuno's avatar

@Snapey Thanks! I updated mockery alone and that didn't work, uninstalling/reinstalling did the trick.

Please or to participate in this conversation.