Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lastest nunomaduro/collision requires Laravel 8 #111

Closed
ekandreas opened this issue Jun 25, 2020 · 22 comments
Closed

Lastest nunomaduro/collision requires Laravel 8 #111

ekandreas opened this issue Jun 25, 2020 · 22 comments

Comments

@ekandreas
Copy link

Latest version 5.0.0-BETA3 of nunomaduro/collision requires Laravel 8. Perhaps it is a bit too forward right now as Laravel 8 isn't released yet?

@ekandreas
Copy link
Author

My workaround to get pest to work in L7:

        "nunomaduro/collision": "5.0.0-BETA2",
        "pestphp/pest": "0.2.1",
        "pestphp/pest-plugin-livewire": "*",

@owenvoke
Copy link
Member

Isn't that just for testing as it's in require-dev? 🤔

@nunomaduro
Copy link
Member

Hum? nunomaduro/collision doesn't not require laravel 8

@ekandreas
Copy link
Author

@nunomaduro
Copy link
Member

That's is require-dev ...

@owenvoke
Copy link
Member

@ekandreas, that's a require-dev entry. It's only for the development and unit testing, Collision 5 still works with Laravel 7 (I just did a test install to check). 👍

I guess laravel: [7.0, 8.0] could be added to the CI matrix to test both if really necessary? 🤷

@ekandreas
Copy link
Author

Yest, pest is placed in require-dev and therefore getting the lastest update 0.2.2 that requires beta3 and laravel 8.

@ekandreas
Copy link
Author

So where do you want me to put pest to get this to work again?

@ekandreas
Copy link
Author

Never mind, just forcing pest to use beta2 solves the issue for now:

        "nunomaduro/collision": "5.0.0-BETA2",
        "pestphp/pest": "0.2.2",
        "pestphp/pest-plugin-livewire": "*"

As you have "nunomaduro/collision": "^5.0.0-BETA2" with the ^-sign it will grab beta3 and force it to Laravel 8.
Your composer should perhaps say: "nunomaduro/collision": "5.0.0-BETA2" ?

@owenvoke
Copy link
Member

It won't force to Laravel 8 🤔

Just ran through an install with a fresh Laravel 7 app. It stays on Laravel 7 because require-dev in a package has no effect on projects/packages that require it.
https://asciinema.org/a/jqYTxyualIilRwrDuNZ39PexY

@ekandreas
Copy link
Author

Ohh, yes, as long as you have ^ in the version numbering it will take the latest package and install beta3.
Working around this with a more declarative setting for the collision package for now.

@ekandreas
Copy link
Author

But if it's only me that have this issue we can close it and hope that no one else stumbles on it as they upgrade to the latest pest package.

@owenvoke
Copy link
Member

Mine did install v5.0.0-BETA3 and it was fine. I'm not sure what the issue is, Collision v5.0.0-BETA3 is compatible with Laravel 7 and 8, and does not force either to be installed. 🤔

@ekandreas
Copy link
Author

I still argue that beta 3 forces L8: https://github.com/nunomaduro/collision/blob/stable/composer.json

@nunomaduro
Copy link
Member

lol, it doesn't.

@adalessa
Copy link

adalessa commented Jul 5, 2020

After a fresh install I found the following as was mentioned here that required dev does not generates a conflict for installation on composer, but trying to run php artisan test is throwing an error from this line https://github.com/nunomaduro/collision/blob/stable/src/Adapters/Laravel/Commands/TestCommand.php#L71
running pest command from the vendor directory great.

@ratacibernetica
Copy link

ratacibernetica commented Jul 5, 2020

I'm with @adalessa here, tried a new Laravel app from scratch, then installing Livewire and finally Pest:

~> composer require phpunit/phpunit:"^9.0" --dev --update-with-dependencies
~> composer require nunomaduro/collision:"^5.0" --dev --update-with-dependencies
~> composer require pestphp/pest --dev
~> composer require pestphp/pest-plugin-laravel --dev && php artisan pest:install
~> ./vendor/bin/pest 


   PASS  Tests\Unit\ExampleTest
  ✓ basic test

   PASS  Tests\Feature\ExampleTest
  ✓ basic test

  Tests:  2 passed
  Time:   0.15s

~> php artisan test                                                                                  

   RuntimeException 

  Running Collision ^5.0 artisan test command requires Laravel ^8.0.

  at vendor/nunomaduro/collision/src/Adapters/Laravel/Commands/TestCommand.php:71
     67▕         }
     68▕ 
     69▕         // @phpstan-ignore-next-line
     70▕         if ((int) \Illuminate\Foundation\Application::VERSION[0] < 8) {
71▕             throw new RuntimeException('Running Collision ^5.0 artisan test command requires Laravel ^8.0.');
     72▕         }
     73
     74$options = array_slice($_SERVER['argv'], $this->option('without-tty') ? 3 : 2);
     75

      +14 vendor frames 
  15  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

here's my composer.json

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.2.5",
        "fideloper/proxy": "^4.2",
        "fruitcake/laravel-cors": "^1.0",
        "guzzlehttp/guzzle": "^6.3",
        "laravel/framework": "^7.0",
        "laravel/tinker": "^2.0",
        "livewire/livewire": "^1.3"
    },
    "require-dev": {
        "facade/ignition": "^2.0",
        "fzaninotto/faker": "^1.9.1",
        "mockery/mockery": "^1.3.1",
        "nunomaduro/collision": "^5.0",
        "pestphp/pest": "^0.2.3",
        "pestphp/pest-plugin-laravel": "^0.2.0",
        "phpunit/phpunit": "^9.0"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/"
        },
        "classmap": [
            "database/seeds",
            "database/factories"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    }
}

@owenvoke
Copy link
Member

owenvoke commented Jul 5, 2020

Yeah, using the Artisan command in Collision 5 does require Laravel 8. I've never used the test command as it just calls Pest behind the scenes.

It looks like this is due to the dotenv package which released a new version. nunomaduro/collision#132

@nunomaduro
Copy link
Member

~> php artisan test                                                                                  

   RuntimeException 

  Running Collision ^5.0 artisan test command requires Laravel ^8.0.

Maybe we should support both dotenv versions on nunomaduro/collision. Basicly have two functions that does different jobs up to the dotenv version.

Someone wants to work on this?

@owenvoke
Copy link
Member

owenvoke commented Jul 5, 2020

@nunomaduro I'd be happy to take a look tomorrow if I have time. If anyone else wants to take this before though, I'm fine with that. 👍

@nunomaduro
Copy link
Member

thanks, the goal is try to support both dotenv 4 and 5 at the same time.

@ekandreas
Copy link
Author

This is still a problem for us. Pest requires Laravel 8. Perhaps we have to wait for September before we can accelerate Pest testing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants