lampyon's avatar

Simple PHPUnit test for a small class

Hello!

I want test a simple class, but I don't know how... I get error always...

http://laravel.io/bin/eDPek

I want a simple unit test and not application test. :(

The answer is: RuntimeException: Session store not set on request.

Or if don't mock session: ReflectionException: Class config does not exist

Or I try another way, but... PHP Fatal error: Cannot redeclare Mockery_2_Illuminate_Support_Facades_Request::shouldReceive() in /srv/www/nidoran/vendor/mockery/mockery/library/Mockery/Loader/EvalLoader.php(16) : eval()'d code on line 770 Or same error, with Facades_Session::shouldReceive()....

Or.. RuntimeException: A facade root has not been set.

BUT never work...

What's the correct test?

I don't know...

0 likes
1 reply
zachleigh's avatar

Pretty sure you need to call the parent setUp method in your classes setUp method.

1 like

Please or to participate in this conversation.