diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..75e9951 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,18 @@ +{ + "name": "mindplay/sql", + "dockerComposeFile": "../docker-compose.yml", + "service": "php", + "workspaceFolder": "/app", + "customizations": { + "vscode": { + "extensions": [ + "DEVSENSE.phptools-vscode", + "xdebug.php-debug" + ] + }, + "settings": { + "php.validate.executablePath": "/usr/local/bin/php" + } + }, + "postCreateCommand": "composer update" +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..f3048f5 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,14 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Debug test/test.php", + "type": "php", + "request": "launch", + "cwd": "/app", + "program": "/app/test/test.php", + "externalConsole": false, + "port": 9003 + } + ] +} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 10ebbca..29da105 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,7 @@ RUN apt-get update && apt-get install -y \ libpq-dev \ mariadb-client \ unzip \ + git \ && docker-php-ext-install pdo pdo_mysql pdo_pgsql # Install xdebug diff --git a/README.md b/README.md index 43e643a..cac71e6 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,13 @@ Code adheres to [PSR-2](http://www.php-fig.org/psr/psr-2/) and [PSR-4](http://ww You need a working [Docker](https://docs.docker.com/get-docker/) installation to run the tests. +#### Using VS Code + +The project includes a [DevContainer](https://containers.dev/) and a `launch.json` for testing and debugging +with VS Code - just open the project in VS Code, hit `F5` to run the tests, and you should be good to go. ✨ + +#### Using Docker + To launch Docker and run the test-suite, e.g. in PHP `8.3`: ./test.sh 8.3