Behat-Laravel-Extension icon indicating copy to clipboard operation
Behat-Laravel-Extension copied to clipboard

Not compatible with Laravel 5.6

Open chriscornford opened this issue 7 years ago • 7 comments

Getting the following error

In RemoveUnusedDefinitionsPass.php line 75:
                                             
  Serialization of 'Closure' is not allowed  

Similar to #72, it won't work with Laravel 5.6 as it now pulls in Symfony 4 components and has a requirement for symfony/dependency-injection (^4.1) meaning downgrading to symfony/dependency-injection:"3.*" will no longer work.

chriscornford avatar Jun 02 '18 13:06 chriscornford

The same here. Just installed Laravel 5.6 and Behat Extension, but it fails when I run:

vendor/bin/behat --init giving the error described by @chriscornford

Trying to install symfony/dependency-injection:"3.*" raise an error due ^4.1 requirement.

Any Idea?

cnastasi avatar Jun 07 '18 10:06 cnastasi

Think I may have this working using flaxandteal/Behat-Laravel-Extension@6fb801694365cdccd6cb3721e4abda7549e9aa97 - however, I am not familiar with Symfony DI so, as indicated in Behat/Behat#1108, I would be keen to get feedback from someone more knowledgeable about it before tidying for PR.

Nonetheless, combining this with flaxandteal/Behat@8f9c9d9a4dc857bc3d7437bd4ea27d3e2b2297d7 I have been able to run Behat-Laravel-Extension with Laravel 5.6

philtweir avatar Jul 12 '18 15:07 philtweir

I'm facing the same issue

titopixelfusion avatar Aug 03 '18 02:08 titopixelfusion

@philtweir Thanks! That worked! For anyone else having this problem recently: make sure you apply the changes from each of the links mentioned by @philtweir, you will have to change two files: BehatExtension.php and HelperContainerExtension.php

Cheers!

edumueller avatar Aug 07 '18 03:08 edumueller

Thanks for the feedback @edumueller ! As the upstream bugfix has now been merged (Behat/Behat#1163) and it seems this works for others OK, I've PR'd the above in #81

philtweir avatar Aug 07 '18 09:08 philtweir

How did you get this to work? I've added to composer the repository to flaxandteal/Behat-Laravel-Extension and tried with dev-master and dev-bug/78-not-compatible-with-laravel-56 but I should put also "symfony/dependency-injection": "^4.1" as a composer require-dev. Is that correct?

jopicornell avatar Oct 08 '18 09:10 jopicornell

That should work - IIRC, symfony/dependency-injection will be pulled in from 4.x by Laravel automatically, so explicitly adding the 3.x requirement was essentially to avoid the breaking change (that should no longer be breaking).

Did you still have the same error message as at the start of this thread after pulling in dev-master Behat and dev-bug/78-not-compatible-with-laravel-56 from flaxandteal/Behat-Laravel-Extension?

philtweir avatar Oct 08 '18 12:10 philtweir