From 8b04b4fd35e542ac3151f89664f8df9fc2429625 Mon Sep 17 00:00:00 2001 From: Stephen Rees-Carter Date: Tue, 26 May 2026 16:00:58 +0900 Subject: [PATCH 1/3] Fix tests --- .github/workflows/php.yml | 2 +- README.md | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 8edb0ee..70d4eb7 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -29,7 +29,7 @@ jobs: run: composer validate --strict - name: Install Dependencies - run: composer install --no-interaction --prefer-dist --optimize-autoloader + run: composer ${{ (matrix.php-versions == '7.1' || matrix.php-versions == '7.2') && 'update --prefer-lowest --prefer-stable' || 'install' }} --no-interaction --prefer-dist --optimize-autoloader - name: Tests run: ./vendor/bin/phpunit ./tests diff --git a/README.md b/README.md index 44ffeba..a204f04 100644 --- a/README.md +++ b/README.md @@ -191,6 +191,24 @@ Laravel and PHP developers! Contributions are very welcome! There isn't a formal guide, but throw in an Issue or PR, and we'll go from there. +### Running the tests + +On PHP 7.3 and later, a normal install works: + +```bash +composer install +./vendor/bin/phpunit ./tests +``` + +On PHP 7.1 and 7.2, recent patches of PHPUnit's transitive dependencies have dropped support for those versions, so install the lowest compatible set of dev dependencies instead: + +```bash +composer update --prefer-lowest --prefer-stable +./vendor/bin/phpunit ./tests +``` + +This only affects dev dependencies — runtime dependencies are unchanged. + ## Security Vulnerabilities Please report any security vulnerabilities via the [GitHub project](https://github.com/valorin/random) From 99e25dc044007299841fba2fbe36878971bda035 Mon Sep 17 00:00:00 2001 From: Stephen Rees-Carter Date: Tue, 26 May 2026 16:15:30 +0900 Subject: [PATCH 2/3] Another attempt at fixing... --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bfaa9fd..177e168 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ }, "require-dev": { "illuminate/support": "^5.0 || ^10.0 || ^11.0 || ^12.0", - "phpunit/phpunit": "^7.0 || ^9.6 || ^10.5" + "phpunit/phpunit": "^7.5 || ^9.6 || ^10.5" }, "autoload": { "psr-4": { From 167de45f834d96d77c85ad9f80c4770fa6704b1a Mon Sep 17 00:00:00 2001 From: Stephen Rees-Carter Date: Tue, 26 May 2026 16:26:00 +0900 Subject: [PATCH 3/3] Remove unit tests for 7.1 and 7.2 due to incompatibility --- .github/workflows/php.yml | 8 +++++++- README.md | 11 +---------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 70d4eb7..81179d8 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -28,8 +28,14 @@ jobs: - name: Validate composer.json and composer.lock run: composer validate --strict + - name: Lint (syntax check only) + if: matrix.php-versions == '7.1' || matrix.php-versions == '7.2' + run: find src tests -name '*.php' -print0 | xargs -0 -n1 php -l + - name: Install Dependencies - run: composer ${{ (matrix.php-versions == '7.1' || matrix.php-versions == '7.2') && 'update --prefer-lowest --prefer-stable' || 'install' }} --no-interaction --prefer-dist --optimize-autoloader + if: matrix.php-versions != '7.1' && matrix.php-versions != '7.2' + run: composer install --no-interaction --prefer-dist --optimize-autoloader - name: Tests + if: matrix.php-versions != '7.1' && matrix.php-versions != '7.2' run: ./vendor/bin/phpunit ./tests diff --git a/README.md b/README.md index a204f04..ec1acec 100644 --- a/README.md +++ b/README.md @@ -193,21 +193,12 @@ Contributions are very welcome! There isn't a formal guide, but throw in an Issu ### Running the tests -On PHP 7.3 and later, a normal install works: - ```bash composer install ./vendor/bin/phpunit ./tests ``` -On PHP 7.1 and 7.2, recent patches of PHPUnit's transitive dependencies have dropped support for those versions, so install the lowest compatible set of dev dependencies instead: - -```bash -composer update --prefer-lowest --prefer-stable -./vendor/bin/phpunit ./tests -``` - -This only affects dev dependencies — runtime dependencies are unchanged. +PHP 7.1 and 7.2 are still supported at runtime, but PHPUnit's current dev-dependency chain no longer installs on them. CI syntax-checks the source on those versions via `php -l` instead of running the test suite — enough to catch any code that wouldn't parse on PHP 7.1/7.2. The full test suite runs on PHP 7.3 and later. ## Security Vulnerabilities