diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6292b9d..523fafd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,7 +46,7 @@ jobs: - name: Run PHPUnit tests run: | - docker compose exec -T php-fpm ./vendor/bin/phpunit tests + docker compose exec -T php-fpm ./vendor/bin/phpunit --coverage-text --testdox tests - name: Test Redis run: | diff --git a/compose.yml b/compose.yml index 1b0036c..0e50fc5 100644 --- a/compose.yml +++ b/compose.yml @@ -21,7 +21,7 @@ services: - ".:/app" - "./docker/php-fpm/php-overrides.ini:/usr/local/etc/php/conf.d/php-overrides.ini" environment: - XDEBUG_MODE: "debug" + XDEBUG_MODE: "coverage" redis: image: "redis:7.2.5-alpine" diff --git a/composer.json b/composer.json index 65a9d51..8caf422 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,10 @@ { "require-dev": { "phpunit/phpunit": "^11.2.1" + }, + "autoload": { + "psr-4": { + "App\\": "src/" + } } } diff --git a/docker/nginx/nginx.conf b/docker/nginx/nginx.conf index cd94e2b..b033c4a 100644 --- a/docker/nginx/nginx.conf +++ b/docker/nginx/nginx.conf @@ -6,7 +6,7 @@ server { access_log /var/log/nginx/app.access.log; - root /app/public; + root /app/src/public; index index.php; location / { diff --git a/docker/php-fpm/php-overrides.ini b/docker/php-fpm/php-overrides.ini index 3392351..62e61d3 100644 --- a/docker/php-fpm/php-overrides.ini +++ b/docker/php-fpm/php-overrides.ini @@ -1,6 +1,6 @@ upload_max_filesize=100M post_max_size=100M -xdebug.mode=debug +xdebug.mode=coverage xdebug.start_with_request=yes xdebug.client_port=9003 xdebug.client_host=host.docker.internal diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..e069076 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,18 @@ + + + + + tests + + + + + src + + + diff --git a/src/Example.php b/src/Example.php new file mode 100644 index 0000000..27c716e --- /dev/null +++ b/src/Example.php @@ -0,0 +1,12 @@ +assertTrue(true); + $example = new Example(); + $this->assertTrue($example->doSomething()); } }