diff --git a/docker/common/unified/Dockerfile b/docker/common/unified/Dockerfile index 7bd634a..d6a5f7c 100644 --- a/docker/common/unified/Dockerfile +++ b/docker/common/unified/Dockerfile @@ -138,7 +138,11 @@ EXPOSE 80 9000 # Start supervisor which manages both Nginx and PHP-FPM CMD ["supervisord", "-c", "/etc/supervisor/supervisord.conf"] -# CI: install dev dependencies and run PHPUnit (build fails if tests fail) +# CI: install dev dependencies and run PHPUnit (build with --target backend-test) FROM builder AS backend-test +ENV APP_KEY=base64:2fl3rk3lI6+k9tJ0lZp2aXh6sL9mN4pQ7rT1vW5yZ8A= RUN composer install --no-interaction --prefer-dist --no-scripts \ && ./vendor/bin/phpunit --no-coverage + +# Default production image target (use --target base for deploy builds) +FROM base AS production diff --git a/phpunit.xml b/phpunit.xml index 6b25d0d..8ed9534 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -19,6 +19,7 @@ + diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php index 8364a84..c1ced65 100644 --- a/tests/Feature/ExampleTest.php +++ b/tests/Feature/ExampleTest.php @@ -14,6 +14,6 @@ class ExampleTest extends TestCase { $response = $this->get('/'); - $response->assertStatus(200); + $response->assertRedirect('/login'); } }