Skip to content

phpunit-bridge does not take composer settings into account when downloading phpunit #27753

@guilhermednt

Description

@guilhermednt

Symfony version(s) affected: 4

Description
phpunit-bridge/simple-phpunit seems to always download PHPUnit from github.com which is problematic if your build server does not have Internet access.

Our build server does not have Internet access, instead it uses a local Artifactory instance as a proxy/cache. Since phpunit-bridge always downloads from GitHub we can't run tests during our build.

How to reproduce
Configure composer to use a local repository, disable packagist and try to run phpunit in a server with no Internet access:

$ composer config repositories.my_local https://repository.example.com/api/composer/php-remote
$ composer config repo.packagist false
$ composer install
$ bin/phpunit

Possible Solution
Use composer to download phpunit.

Additional context

Jenkins log:

+ composer test
> bin/phpunit
#!/usr/bin/env php
PHP Fatal error:  Uncaught RuntimeException: Could not find https://github.com/sebastianbergmann/phpunit/archive/6.5.zip in .../jenkins/workspace/demo/vendor/symfony/phpunit-bridge/bin/simple-phpunit:99
Stack trace:
#0 .../jenkins/workspace/demo/bin/phpunit(18): require()
#1 {main}
  thrown in .../jenkins/workspace/demo/vendor/symfony/phpunit-bridge/bin/simple-phpunit on line 99
Script bin/phpunit handling the test event returned with error code 255

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