php-vcr / phpunit-testlistener-vcr

Integrates PHPUnit with PHP-VCR.
MIT License
61 stars 50 forks source link

Does not work with Laravel 5.5? #24

Closed cerw closed 6 years ago

cerw commented 6 years ago

Follow the documents, but seem laravel is not liking this? I a missing something?

Starting test 'Tests\Feature\APITest::testCanSeeSessions'.
.PHP Fatal error:  Uncaught Illuminate\Contracts\Container\BindingResolutionException: Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable. in /Users/cerw/Work/slsa/Operations/vendor/laravel/framework/src/Illuminate/Container/Container.php:918
Stack trace:
#0 /Users/cerw/Work/slsa/Operations/vendor/laravel/framework/src/Illuminate/Container/Container.php(758): Illuminate\Container\Container->notInstantiable('Illuminate\\Cont...')
#1 /Users/cerw/Work/slsa/Operations/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build('Illuminate\\Cont...')
#2 /Users/cerw/Work/slsa/Operations/vendor/laravel/framework/src/Illuminate/Container/Container.php(586): Illuminate\Container\Container->resolve('Illuminate\\Cont...', Array)
#3 /Users/cerw/Work/slsa/Operations/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(732): Illuminate\Container\Container->make('Illuminate\\Cont...', Array)
#4 /Users/cerw/Work/slsa/Operations/vendor/laravel/framework/src/Illu in /Users/cerw/Work/slsa/Operations/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 918

Fatal error: Uncaught Illuminate\Contracts\Container\BindingResolutionException: Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable. in /Users/cerw/Work/slsa/Operations/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 918

Illuminate\Contracts\Container\BindingResolutionException: Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable. in /Users/cerw/Work/slsa/Operations/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 918

Call Stack:
    0.9168   23299384   1. Illuminate\Foundation\Bootstrap\HandleExceptions->handleException() /Users/cerw/Work/slsa/Operations/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:0
    0.9172   23309880   2. Illuminate\Foundation\Bootstrap\HandleExceptions->renderForConsole() /Users/cerw/Work/slsa/Operations/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:87
    0.9172   23309880   3. Illuminate\Foundation\Bootstrap\HandleExceptions->getExceptionHandler() /Users/cerw/Work/slsa/Operations/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:101
    0.9172   23309880   4. Illuminate\Foundation\Application->make() /Users/cerw/Work/slsa/Operations/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:159
    0.9172   23309880   5. Illuminate\Foundation\Application->make() /Users/cerw/Work/slsa/Operations/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:732
    0.9172   23309880   6. Illuminate\Foundation\Application->resolve() /Users/cerw/Work/slsa/Operations/vendor/laravel/framework/src/Illuminate/Container/Container.php:586
    0.9173   23309880   7. Illuminate\Foundation\Application->build() /Users/cerw/Work/slsa/Operations/vendor/laravel/framework/src/Illuminate/Container/Container.php:631
    0.9173   23309992   8. Illuminate\Foundation\Application->notInstantiable() /Users/cerw/Work/slsa/Operations/vendor/laravel/framework/src/Illuminate/Container/Container.php:758

PHP Fatal error:  Uncaught Error: Class 'Symfony\Component\Debug\Exception\FatalErrorException' not found in /Users/cerw/Work/slsa/Operations/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:136
Stack trace:
#0 /Users/cerw/Work/slsa/Operations/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(123): Illuminate\Foundation\Bootstrap\HandleExceptions->fatalExceptionFromError(Array, 0)
#1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleShutdown()
#2 {main}
  thrown in /Users/cerw/Work/slsa/Operations/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php on line 136

Fatal error: Uncaught Error: Class 'Symfony\Component\Debug\Exception\FatalErrorException' not found in /Users/cerw/Work/slsa/Operations/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php on line 136

Error: Class 'Symfony\Component\Debug\Exception\FatalErrorException' not found in /Users/cerw/Work/slsa/Operations/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php on line 136

Call Stack:
    0.9177   23320864   1. Illuminate\Foundation\Bootstrap\HandleExceptions->handleShutdown() /Users/cerw/Work/slsa/Operations/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:0
    0.9177   23322776   2. Illuminate\Foundation\Bootstrap\HandleExceptions->fatalExceptionFromError() /Users/cerw/Work/slsa/Operations/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:123
cristiancalara commented 6 years ago

Hi @cerw

I've ran into the same issue. The above issue is described here

But this only happens if an exception is thrown by the listener. After creating the "fixtures" folder, no exception was thrown in my case so I could use the package.

nshontz commented 6 years ago

@cristiancalara where/why did you create the "fixtures" folder? I'm not seeing that referenced anywhere.

cristiancalara commented 6 years ago

@nshontz I've created it because I think the package was only checking if the folder exists, not actually creating it. Not sure, as some time has passed.

For where, I have it in tests/fixtures. But you can configure it in a bootstrap file, see this issue

renatomefi commented 6 years ago

Thanks for linking and pointing everything to their places! If any of you feel like it you can add a Laravel section to our documentation, it'd be great!

Thanks again, I'm closing this for now, feel free to reopen in case of need!

JohannCarfantan commented 6 years ago

Hi guys, I have the exact same issue as described in here

@cerw did you fixed this problem? If you did, how?

@cristiancalara could you explain a bit more how did you do? Are you really running Laravel 5.5?

Thanks