symfony: Problem with installing simple-phpunit in docker
Symfony version(s) affected: 4.4.1
**phpunit-bridge version: 5.0.5
Description
When i want to install php unit (with ./vendor/bin/simple-phpunit install command) before copying all my src files (for prevent the reinstallation of vendors at every changes in the source code), the test i execute (before copying src files) fails
How to reproduce
Create a Dockerfile from a symfony project with:
# Copia solo dependencias y las instala
COPY composer.json composer.lock symfony.lock ./
RUN set -eux; \
composer install --prefer-dist --no-scripts --no-progress --no-suggest; \
composer clear-cache
RUN ./vendor/bin/simple-phpunit install
# copy only specifically what we need
COPY .env ./
COPY bin bin/
COPY config config/
COPY public public/
COPY src src/
RUN set -eux; \
mkdir -p var/cache var/log; \
composer dump-autoload --classmap-authoritative; \
composer run-script --no-dev post-install-cmd; \
chmod +x bin/console; sync
# Copia el codigo fuente a donde corresponde dentro del contenedor
COPY [".", "/var/www/"]
# Crea la base de datos y la carga con fixtures
RUN php bin/console doctrine:database:create --env=test --no-debug
RUN php bin/console doctrine:schema:update --env=test --force --no-debug
RUN php bin/console hautelook:fixtures:load --env=test
# Ejecuta testing
RUN ./vendor/bin/simple-phpunit tests # THIS FAILS
OUTPUT

About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (12 by maintainers)
found it!
before i do “copy all files to the image” it is using the phpunit.xml.dist from the symfony recipe: https://github.com/symfony/recipes/blob/master/symfony/phpunit-bridge/4.1/phpunit.xml.dist
if it’s empty-string the default isn’t used and therefore it does not contain phpspec/prophecy
after the “copy all” my own phpunit.xml.dist from git is used, which does not contain the SYMFONY_PHUNIT_REMOVE variable set to empty string, therefore that “env” var is changed. Thanks for hint.
Now I wonder what should be the default for 8.3? empty string or “phpspec/prophecy” ?