Skip to content

[PhpUnitBridge] Disable interaction during install #41849

Closed
@ogizanagi

Description

@ogizanagi

Symfony version(s) affected: 5.3.0

Description

Whenever using :

  1. <env name="SYMFONY_PHPUNIT_REQUIRE" value="phpspec/prophecy-phpunit"/> ([PhpUnitBridge] Add SYMFONY_PHPUNIT_REQUIRE env variable #40059)
  2. with Composer >= 2.1.0 (Show a warning if require key changes for dependency composer/composer#9542)
  3. and running vendor/bin/simple-phpunit with PHPUnit 9.5 for the first time

you'll get this warning:

phpspec/prophecy-phpunit is currently present in the require-dev key and you ran the command without the --dev flag, which would move it to the require key.

screenshot 2021-06-24 à 21 29 12

since phpspec/prophecy-phpunit is in the require-dev section of sebastianbergmann/phpunit:

https://github.com/sebastianbergmann/phpunit/blob/fb9b8333f14e3dce976a60ef6a7e05c7c7ed8bfb/composer.json#L53-L56

Which is not much an issue in most cases, but:

  1. it'll ask interactively the user about something he doesn't really mind about, since they're just running simple-phpunit
  2. in some cases, it can be an issue in a CI env (a workmate originally reported this issue to me because it makes his CI fail (Circle CI) because the interactive shell is not disabled by default).

Possible Solution

What about enforcing simple-phpunit to run these commands with --no-interaction?
The issue can already be circumvented, for instance by defining the COMPOSER_BINARY=composer --interactive env var. But is it worth it to ask anything to the user here?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions