#!/bin/bash
XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-clover=coverage.clover.xml --log-junit log.junit.xml
docker run --rm -v "$(pwd):/usr/src" \
--add-host host.docker.internal:host-gateway \
sonarsource/sonar-scanner-cli \
-Dsonar.projectKey=<projectKey> \
-Dsonar.host.url=http://host.docker.internal:9000 \
-Dsonar.login=<accessToken> \
-Dsonar.exclusions=vendor/**,coverage.clover.xml,log.junit.xml \
-Dsonar.sourceEncoding=UTF-8 \
-Dsonar.php.tests.reportPaths=log.junit.xml \
-Dsonar.php.coverage.reportPaths=coverage.clover.xml \
-Dsonar.sources=src \
-Dsonar.tests=tests