Laravel Unit Tests. I can not instantiate the class

1

My problem is apparently simple, but I can not resolve it.

I tried to test in my application, and in the beginning I had problems

I run the following command line to run the test:

vendor/bin/phpunit

In the test I'm just instantiating the User class:

$user = \Escola\User;

And I get the following error message:

[Symfony\Component\Debug\Exception\FatalErrorException]  
Undefined constant 'Escola\User'                                                                                         
Fatal error: Undefined constant 'Escola\User' in  
/home/f15/Desktop/escola/tests/PedidoTest.php on line 11
    
asked by anonymous 11.10.2017 / 16:45

1 answer

1

You need to use keyword new to instantiate something

$user = new \Escola\User;
    
11.10.2017 / 16:53