laravel / browser-kit-testing

Provides backwards compatibility for BrowserKit testing in the latest Laravel release.
MIT License
508 stars 75 forks source link

Dependency Issue on Laravel 6.9.x #113

Closed nafiesl closed 4 years ago

nafiesl commented 4 years ago

Description:

Hi, when installing this package to Laravel 6.9.x, I have got this dependency error.

  Problem 1
    - Conclusion: don't install laravel/browser-kit-testing v5.1.3
    - Installation request for symfony/css-selector (locked at v5.0.2) -> satisfiable by symfony/css-selector[v5.0.2].
    - Conclusion: remove laravel/framework v6.9.0
    - Conclusion: don't install laravel/framework v6.9.0
    - laravel/browser-kit-testing v5.1.0 requires illuminate/http ~5.7.0|~5.8.0 -> satisfiable by illuminate/http[5.7.17, 5.7.18, 5.7.19, 5.7.x-dev, 5.8.x-dev, v5.7.0, v5.7.1, v5.7.10, v5.7.11, v5.7.15, v5.7.2, v5.7.20, v5.7.21, v5.7.22, v5.7.23, v5.7.26, v5.7.27, v5.7.28, v5.7.3, v5.7.4, v5.7.5, v5.7.6, v5.7.7, v5.7.8, v5.7.9, v5.8.0, v5.8.11, v5.8.12, v5.8.14, v5.8.15, v5.8.17, v5.8.18, v5.8.19, v5.8.2, v5.8.20, v5.8.22, v5.8.24, v5.8.27, v5.8.28, v5.8.29, v5.8.3, v5.8.30, v5.8.31, v5.8.32, v5.8.33, v5.8.34, v5.8.35, v5.8.36, v5.8.4, v5.8.8, v5.8.9].
...
...
    - don't install illuminate/http 5.7.17|don't install laravel/framework v6.9.0
    - don't install illuminate/http 5.7.18|don't install laravel/framework v6.9.0
...
...
    - don't install illuminate/http v5.8.8|don't install laravel/framework v6.9.0
    - don't install illuminate/http v5.8.9|don't install laravel/framework v6.9.0
    - Installation request for laravel/framework (locked at v6.9.0, required as ^6.2) -> satisfiable by laravel/framework[v6.9.0].
    - Installation request for laravel/browser-kit-testing ^5.1 -> satisfiable by laravel/browser-kit-testing[v5.1.0, v5.1.1, v5.1.2, v5.1.3].

Installation failed, reverting ./composer.json to its original content.

Steps To Reproduce:

$ laravel new laravel_6x
$ cd laravel_6x
$ composer require laravel/browser-kit-testing --dev

I think the problem is this dependency. https://github.com/laravel/browser-kit-testing/blob/5.0/composer.json#L23 Somehow we were forced to use symfony/css-selector version 5.x.

Maybe we should use change these lines https://github.com/laravel/browser-kit-testing/blob/5.0/composer.json#L22-L26 to :

"symfony/console": "^4.2 | ^5.0",
"symfony/css-selector": "^4.2 | ^5.0",
"symfony/dom-crawler": "^4.2 | ^5.0",
"symfony/http-foundation": "^4.2 | ^5.0",
"symfony/http-kernel": "^4.2 | ^5.0"

Thanks.

svpernova09 commented 4 years ago

Running into this issue this morning as well.

driesvints commented 4 years ago

I've reverted the PR for this. Please see my remarks on the PR itself.

I'm not sure where symfony/css-selector with a ^5.0 requirement comes from but Laravel 6 (or any below version) doesn't supports Symfony 5. Symfony 5 support will be released with Laravel 7 at the end of February and Browser Kit Testing 6 will be released with Symfony 5 support as well then.

nafiesl commented 4 years ago

I'm not sure where symfony/css-selector with a ^5.0 requirement comes from

I will help to investigate it.

nafiesl commented 4 years ago

Hi @driesvints, I found that current laravel 6.9.0 is dependent to tijsverkoyen/css-to-inline-styles:^2.2.1 which dependent to symfony/css-selector.

On latest laravel installation, we will have tijsverkoyen/css-to-inline-styles:2.2.2 installed, which will also installs symfony/css-selector:v5.0.2. This is why laravel/browser-kit-testing cannot be installed since it does not compatible with symfony/css-selector:v5.x.

I think we have 3 choises here:

  1. Change dependent version of tijsverkoyen/css-to-inline-styles on laravel/framework dependencies to <=2.2.1. https://github.com/laravel/framework/blob/6.x/composer.json#L42

    "tijsverkoyen/css-to-inline-styles": "<=2.2.1",

    So we will only get this package up to v2.2.1 (at least for laravel 6.x). #2.2.1 vs #2.2.2

  2. We add support (only) for symfony/css-selector:5.x on browser-kit-test package:5.0.x

    "symfony/css-selector": "^4.2 | 5.0.*",
  3. We ask tijsverkoyen/css-to-inline-styles to remove dependency of symfony/css-selector:5.x for version 2.2.x.

What do you think @driesvints?

driesvints commented 4 years ago

@nafiesl that library also supports 4.x so it should be perfectly possible to install both that library and browser kit testing 5.x in laravel 6.x:

https://github.com/tijsverkoyen/CssToInlineStyles/blob/master/composer.json#L18

nafiesl commented 4 years ago

Ok @driesvints, got your point. I have successfully installed browser-kit-testing this way:

$ composer require symfony/css-selector:^4.0
$ composer require laravel/browser-kit-testing --dev

We require symfony/css-selector 4 directly as the project dependency. At least this helps us to use the package until we have Laravel 7 and Browser Kit Testing 6.

Thanks for your help @driesvints.