You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unit-tests created for PHPUnit 4 generally work in v5, but I experienced problems in context of Binding and Resolution of providers. Example would be:
My app utilizes Cartalyst/Sentinel package and I use it via app('sentinel') initiator. Whenever unit-test works flawlessly, nothing wrong happens. But the moment you have counter-assertion (failing assertion) in tests, an exception similar to this happens:
Stack trace:
#0 /home/shehi/Projects/Basis/vendor/laravel/framework/src/Illuminate/Container/Container.php(627): Illuminate\Container\Container->build('Illuminate\Cont...', Array)
#1 /home/shehi/Projects/Basis/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('Illuminate\Cont...', Array)
#2 /home/shehi/Projects/Basis/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(154): Illuminate\Foundation\Application->make('Illuminate\Cont...')
#3 /home/shehi/Projects/Basis/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(79): Illuminate\Foundation\Bootstrap\HandleExceptions->getExceptionHandler()
#4 [internal function]: Illuminate\Fo' in /home/shehi/Projects/Basis/vendor/laravel/framework/src/Illuminate/Container/Container.php:745
Stack trace:
#0 /home/shehi/Projects/Basis/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(133): Symfony\Component\Debug\Exception\FatalErrorException->__construct()
#1 /home/shehi/Projects/Basis/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(118): Illuminate\Foundation\Bootstrap\HandleExceptions->fatalExceptionFromError()
#2 /home/shehi/Projects/Basis/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(0): Illuminate\Foundation\Bootstrap\HandleExceptions->handleShutdown() #3 {main} [] []```
This exception, by the looks of it, has nothing to do with actual test, as when I downgrade, real assertion errors show up. Also notice in TRACE after #4, it somehow gets concatenated and new trace starts. Kinda weird as an internal function trace pops up there :)
My project in question is: http://github.com/AudithSoftworks/Basis
In any way, I recommend thorough testing of PHPUnit 5 for upcoming Laravel release, including service container, bindings and resolutions scopes especially for cases of failing-assertions.
The text was updated successfully, but these errors were encountered:
Unit-tests created for PHPUnit 4 generally work in v5, but I experienced problems in context of Binding and Resolution of providers. Example would be:
My app utilizes Cartalyst/Sentinel package and I use it via
app('sentinel')
initiator. Whenever unit-test works flawlessly, nothing wrong happens. But the moment you have counter-assertion (failing assertion) in tests, an exception similar to this happens:The text was updated successfully, but these errors were encountered: