From 62a7a0133b0f5e1e4adaa3d2bdfff388a576af1c Mon Sep 17 00:00:00 2001 From: Ben Peachey Date: Mon, 19 May 2025 17:51:35 +0200 Subject: [PATCH 1/6] Remove nyancat-phpunit-resultprinter. --- composer.json | 3 +-- phpunit.xml.dist | 3 --- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 5257566..e0de276 100644 --- a/composer.json +++ b/composer.json @@ -29,8 +29,7 @@ "josegonzalez/dotenv": "~2.0", "phpunit/phpunit" : "~4.8", "satooshi/php-coveralls": "~0.6", - "scrutinizer/ocular": "~1.1", - "whatthejeff/nyancat-phpunit-resultprinter": "~1.2" + "scrutinizer/ocular": "~1.1" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index f04bd2b..0f0f395 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -21,9 +21,6 @@ colors="true" forceCoversAnnotation="true" verbose="true" - - printerFile="vendor/whatthejeff/nyancat-phpunit-resultprinter/src/NyanCat/PHPUnit/ResultPrinter.php" - printerClass="NyanCat\PHPUnit\ResultPrinter" > From 4ae6471f66115a6b8c3232e7239f9861d65395f3 Mon Sep 17 00:00:00 2001 From: Ben Peachey Date: Mon, 19 May 2025 17:52:44 +0200 Subject: [PATCH 2/6] Change PHPUnit noNamespaceSchemaLocation to vendor location. --- phpunit.xml.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 0f0f395..9f9feb8 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,7 +1,7 @@ Date: Mon, 19 May 2025 17:52:57 +0200 Subject: [PATCH 3/6] Fix typo. --- phpunit.xml.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 9f9feb8..a6e85d0 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -23,7 +23,7 @@ verbose="true" > - + tests/unit-tests From 984a9a327515035c970b666b62760cb7bc2f9a73 Mon Sep 17 00:00:00 2001 From: Ben Peachey Date: Mon, 19 May 2025 17:53:41 +0200 Subject: [PATCH 4/6] Add first-draft GitHub Action (GHA) for PHPUnit. --- .github/workflows/tests.php.unit.yml | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/tests.php.unit.yml diff --git a/.github/workflows/tests.php.unit.yml b/.github/workflows/tests.php.unit.yml new file mode 100644 index 0000000..7ba0ab7 --- /dev/null +++ b/.github/workflows/tests.php.unit.yml @@ -0,0 +1,34 @@ +name: PHP Unit Tests + +on: + - push + - pull_request + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + php-version: + - '5.5' + - '5.6' + - '7.0' + include: + - php-version: '7.0' + allow_failure: true + continue-on-error: ${{ matrix.allow_failure || false }} + steps: + - uses: actions/checkout@v4 + - uses: shivammathur/setup-php@v2 + with: + coverage: xdebug + extensions: gd, json, mbstring + php-version: ${{ matrix.php-version }} + - run: composer install --no-interaction --prefer-dist + - run: vendor/bin/phpunit + - uses: codecov/codecov-action@v5 + if: success() + with: + token: ${{ secrets.CODECOV_TOKEN }} + - uses: coverallsapp/github-action@v2 + if: success() From 901b9a84ddcd1e994450b6268b7ae57d7d783fa0 Mon Sep 17 00:00:00 2001 From: Ben Peachey Date: Mon, 19 May 2025 18:00:46 +0200 Subject: [PATCH 5/6] Remove Travis-CI file. --- .travis.yml | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 90567ef..0000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: php - -php: - - 5.5 - - 5.6 - - 7.0 - - hhvm - -sudo: false - -matrix: - allow_failures: - - php: 7.0 - - php: hhvm - -install: - - composer install - -script: - - vendor/bin/phpunit --configuration build/phpunit.xml && cat build/testdox.txt build/coverage.txt - -after_success: - - bash <(curl -s https://codecov.io/bash) - - php vendor/bin/coveralls -v From ca21b98a335f5569aa3ec1ea9447e38c6e0acdb8 Mon Sep 17 00:00:00 2001 From: Ben Peachey Date: Mon, 19 May 2025 18:01:25 +0200 Subject: [PATCH 6/6] Add Dockerfile to run PHPUnit. --- Dockerfile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3f1a4dd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +ARG PHP_VERSION +FROM php:${PHP_VERSION} + +RUN apk add --no-cache \ + libpng \ + libpng-dev \ + ${PHPIZE_DEPS} \ + && docker-php-ext-install gd \ + && pecl install xdebug-2.5.5 \ + && docker-php-ext-enable xdebug \ + && apk del libpng-dev ${PHPIZE_DEPS} + +COPY --from=composer /usr/bin/composer /usr/bin/composer + +ENV XDEBUG_MODE coverage + +WORKDIR /code + +CMD ["php", "./vendor/bin/phpunit"]