mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2026-10-23 02:58:54 +00:00
[Web][Tests] Add PHPUnit setup and imapsync module tests
This commit is contained in:
18 files changed
+3948
-1
No files matched your search
+15
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
# Runs the PHPUnit tests of data/web/inc/lib/mailcow (tests/php) in throwaway containers.
|
||||
# Dev only: PHPUnit is installed into tests/php/vendor, never into the production vendor directory.
|
||||
# Usage: helper-scripts/dev_tests/run_php_unit_tests.sh [phpunit arguments, e.g. --filter JobServiceTest]
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
TESTS_DIR="${REPO_DIR}/tests/php"
|
||||
|
||||
docker run --rm -u "$(id -u):$(id -g)" -v "${TESTS_DIR}:/app" -w /app composer:2 \
|
||||
install --no-interaction --no-progress --quiet
|
||||
|
||||
docker run --rm -u "$(id -u):$(id -g)" -v "${REPO_DIR}:/app" -w /app/tests/php php:8.2-cli \
|
||||
php vendor/bin/phpunit "$@"
|
||||
Reference in new issue
Block a user