Skip to content

Commit

Permalink
maint/update-dock (#8)
Browse files Browse the repository at this point in the history
* maint/update-dock Updated `README.md`.

* maint/update-dock Updated `composer.json`.

* maint/update-dock Updated `dock`.

* maint/update-dock Updated `test.sh`.

* maint/update-dock Updated `composer.json`.

* maint/update-dock Created `phpunit.xml`.

---------

Co-authored-by: david_smith <david_smith@sweetwater.com>
  • Loading branch information
zero-to-prod and david_smith authored Jan 12, 2025
1 parent b84e204 commit 1b163e3
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 16 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ You can specify which PHP version to use for local development, debugging, and C

```dotenv
PHP_VERSION=8.1
PHP_DEBUG=7.1
PHP_COMPOSER=7.1
PHP_DEBUG=8.1
PHP_COMPOSER=8.1
```

Make sure these values reflect the PHP versions you intend to use.
Expand Down
12 changes: 0 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,6 @@
"url": "https://github.com/sponsors/zero-to-prod"
}
],
"scripts": {
"test-all": [
"sh test.sh"
],
"docker": [
"docker compose run --rm "
]
},
"scripts-descriptions": {
"test-all": "tests all php versions",
"docker": "runs a docker container"
},
"bin": [
"bin/data-model-envoyer"
],
Expand Down
2 changes: 1 addition & 1 deletion dock
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ PHP_VERSION=$(grep "^PHP_VERSION=" .env | cut -d '=' -f2-)
case "$1" in
test)
shift
run_service "php${PHP_VERSION}" vendor/bin/phpunit --configuration "docker/${PHP_VERSION}/phpunit.xml" "$@"
run_service "php${PHP_VERSION}" vendor/bin/phpunit "$@"
;;
build)
shift
Expand Down
31 changes: 31 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheDirectory=".phpunit.cache"
executionOrder="depends,defects"
requireCoverageMetadata="false"
beStrictAboutCoverageMetadata="false"
beStrictAboutOutputDuringTests="true"
displayDetailsOnPhpunitDeprecations="true"
failOnPhpunitDeprecation="true"
failOnRisky="true"
failOnWarning="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerNotices="true"
displayDetailsOnTestsThatTriggerWarnings="true"
colors="true"
>
<testsuites>
<testsuite name="default">
<directory>tests</directory>
</testsuite>
</testsuites>

<source restrictDeprecations="true" restrictNotices="true" restrictWarnings="true">
<include>
<directory>src</directory>
</include>
</source>
</phpunit>
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ for PHP_VERSION in "${PHP_VERSIONS[@]}"; do

sh dock "composer${PHP_VERSION}" composer update

if ! sh dock "php${PHP_VERSION}" ./vendor/bin/phpunit --configuration "docker/${PHP_VERSION}/phpunit.xml"
if ! sh dock "php${PHP_VERSION}" ./vendor/bin/phpunit
then
exit 1
fi
Expand Down

0 comments on commit 1b163e3

Please sign in to comment.