I used to use the method setup of PHPUnit to create a instance for my test methods. But in Laravel 5.8 I can\'t do it
I\'ve tried both ways, and it\'s works makes a
Laravel 5.8 added the void typehint to the return type of the setUp
method.
So you have to declare that like this:
public function setUp(): void
{
// you should also call parent::setUp() to properly boot
// the Laravel application in your tests
$this->instance = new MyService;
}
Note the : void
after the function arguments to state the return type of that function