Skip to content

Commit

Permalink
Merge pull request #289 from PrestaShopCorp/fix/phpunit-coverage
Browse files Browse the repository at this point in the history
fix: code coverage regression
  • Loading branch information
emmanuelgautier authored Jan 4, 2023
2 parents 276808d + 69cc271 commit 0b65589
Show file tree
Hide file tree
Showing 7 changed files with 1,397 additions and 576 deletions.
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,22 +118,28 @@ phpstan: check-docker
#PHPUNIT_CMD="./vendor/bin/phpunit"
phpunit: check-docker
# -docker container rm -f phpunit
# FIXME: PS_* vars are useless here as we override run
docker pull prestashop/docker-internal-images:${DOCKER_INTERNAL}
@docker run --rm \
--name phpunit \
-e PS_DOMAIN=localhost \
-e PS_ENABLE_SSL=0 \
-e PS_DEV_MODE=1 \
-e XDEBUG_MODE=coverage \
-e XDEBUG_ENABLED=1 \
-v ${PWD}:/var/www/html/modules/ps_accounts \
-w /var/www/html/modules/ps_accounts \
prestashop/docker-internal-images:${DOCKER_INTERNAL} \
sh -c " \
service mysql start && \
service mariadb start && \
service apache2 start && \
docker-php-ext-enable xdebug && \
if [ ! -f ./config/config.yml ]; then cp ./config/config.yml.dist ./config/config.yml; fi && \
../../bin/console prestashop:module install ps_accounts && \
echo \"Testing module v\`cat config.xml | grep '<version>' | sed 's/^.*\[CDATA\[\(.*\)\]\].*/\1/'\`\n\" && \
chown -R www-data:www-data ../../var/logs && \
XDEBUG_MODE=coverage ./vendor/bin/phpunit \
chown -R www-data:www-data ../../var/cache && \
./vendor/bin/phpunit \
"
@echo phpunit passed

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"prestashopcorp/oauth2-prestashop": "dev-main"
},
"require-dev": {
"phpunit/phpunit": "^5.7",
"phpunit/phpunit": "^8.5",
"prestashop/php-dev-tools": "3.*",
"friendsofphp/php-cs-fixer": "^2.16",
"fzaninotto/faker": "^1.9"
Expand All @@ -44,7 +44,7 @@
"set-license-header": [
"@php ./vendor/bin/header-stamp --license=\"assets/afl.txt\" --exclude=\".github,node_modules,vendor,vendor,tests,_dev\""
],
"phpunit": "docker exec -u www-data -ti phpunit-dev ./vendor/bin/phpunit --configuration './phpunit.xml' --bootstrap './tests/bootstrap.php' --test-suffix 'Test.php,.phpt'"
"phpunit": "docker exec -u www-data -ti phpunit-dev ./vendor/bin/phpunit --configuration './phpunit.xml' --test-suffix 'Test.php,.phpt'"
},
"author": "PrestaShop",
"license": "AFL-3.0",
Expand Down
Loading

0 comments on commit 0b65589

Please sign in to comment.