diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 65513be..5f18810 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,12 +15,15 @@ permissions: contents: read on: + schedule: + - cron: '0 4 * * *' # daily 04:00 UTC canary keepalive pull_request: branches: - "*" push: branches: - 'master' + workflow_dispatch: {} env: COLUMNS: 120 @@ -34,12 +37,12 @@ jobs: JBZOO_COMPOSER_UPDATE_FLAGS: ${{ matrix.composer_flags }} strategy: matrix: - php-version: [ 8.2, 8.3, 8.4 ] + php-version: [ 8.3, 8.4, 8.5 ] coverage: [ xdebug, none ] composer_flags: [ "--prefer-lowest", "" ] steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v7 with: fetch-depth: 0 @@ -71,11 +74,12 @@ jobs: run: make report-coveralls --no-print-directory || true - name: Upload Artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 continue-on-error: true with: name: PHPUnit - ${{ matrix.php-version }} - ${{ matrix.coverage }} path: build/ + overwrite: true linters: @@ -83,10 +87,10 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-version: [ 8.2, 8.3, 8.4 ] + php-version: [ 8.3, 8.4, 8.5 ] steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v7 with: fetch-depth: 0 @@ -105,11 +109,12 @@ jobs: run: make codestyle --no-print-directory - name: Upload Artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 continue-on-error: true with: name: Linters - ${{ matrix.php-version }} path: build/ + overwrite: true report: @@ -117,10 +122,10 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-version: [ 8.2, 8.3, 8.4 ] + php-version: [ 8.3, 8.4, 8.5 ] steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v7 with: fetch-depth: 0 @@ -139,8 +144,9 @@ jobs: run: make report-all --no-print-directory - name: Upload Artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 continue-on-error: true with: name: Reports - ${{ matrix.php-version }} path: build/ + overwrite: true diff --git a/CLAUDE.md b/CLAUDE.md index 783dafa..bb06c81 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -87,7 +87,7 @@ class MyFeatureTest extends PHPUnit ## Dependencies -- PHP 8.2+ required +- PHP 8.3+ required - PHPUnit ^9.6.29 as core testing framework - JBZoo toolbox ecosystem (codestyle, markdown, etc.) - Development dependencies managed via jbzoo/toolbox-dev @@ -95,7 +95,7 @@ class MyFeatureTest extends PHPUnit ## CI/CD GitHub Actions workflow runs: -- PHPUnit tests across PHP 8.1, 8.2, 8.3 +- PHPUnit tests across PHP 8.3, 8.4, 8.5 - Code quality checks (linters) - Coverage reporting to Coveralls - Matrix testing with different Composer flags (--prefer-lowest) \ No newline at end of file diff --git a/README.md b/README.md index 9599ffa..5e7b6c8 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,15 @@ # JBZoo / PHPUnit -[![CI](https://github.com/JBZoo/PHPUnit/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/JBZoo/PHPUnit/actions/workflows/main.yml?query=branch%3Amaster) [![Coverage Status](https://coveralls.io/repos/github/JBZoo/PHPUnit/badge.svg?branch=master)](https://coveralls.io/github/JBZoo/PHPUnit?branch=master) [![Psalm Coverage](https://shepherd.dev/github/JBZoo/PHPUnit/coverage.svg)](https://shepherd.dev/github/JBZoo/PHPUnit) [![Psalm Level](https://shepherd.dev/github/JBZoo/PHPUnit/level.svg)](https://shepherd.dev/github/JBZoo/PHPUnit) [![CodeFactor](https://www.codefactor.io/repository/github/jbzoo/phpunit/badge)](https://www.codefactor.io/repository/github/jbzoo/phpunit/issues) -[![Stable Version](https://poser.pugx.org/jbzoo/phpunit/version)](https://packagist.org/packages/jbzoo/phpunit/) [![Total Downloads](https://poser.pugx.org/jbzoo/phpunit/downloads)](https://packagist.org/packages/jbzoo/phpunit/stats) [![Dependents](https://poser.pugx.org/jbzoo/phpunit/dependents)](https://packagist.org/packages/jbzoo/phpunit/dependents?order_by=downloads) [![GitHub License](https://img.shields.io/github/license/jbzoo/phpunit)](https://github.com/JBZoo/PHPUnit/blob/master/LICENSE) +[![CI](https://github.com/JBZoo/PHPUnit/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/JBZoo/PHPUnit/actions/workflows/main.yml?query=branch%3Amaster) +[![Coverage Status](https://coveralls.io/repos/github/JBZoo/PHPUnit/badge.svg?branch=master)](https://coveralls.io/github/JBZoo/PHPUnit?branch=master) +[![Psalm Coverage](https://shepherd.dev/github/JBZoo/PHPUnit/coverage.svg)](https://shepherd.dev/github/JBZoo/PHPUnit) +[![Psalm Level](https://shepherd.dev/github/JBZoo/PHPUnit/level.svg)](https://shepherd.dev/github/JBZoo/PHPUnit) +[![CodeFactor](https://www.codefactor.io/repository/github/jbzoo/phpunit/badge)](https://www.codefactor.io/repository/github/jbzoo/phpunit/issues) + +[![Stable Version](https://poser.pugx.org/jbzoo/phpunit/version)](https://packagist.org/packages/jbzoo/phpunit/) +[![Total Downloads](https://poser.pugx.org/jbzoo/phpunit/downloads)](https://packagist.org/packages/jbzoo/phpunit/stats) +[![Dependents](https://poser.pugx.org/jbzoo/phpunit/dependents)](https://packagist.org/packages/jbzoo/phpunit/dependents?order_by=downloads) +[![GitHub License](https://img.shields.io/github/license/jbzoo/phpunit)](https://github.com/JBZoo/PHPUnit/blob/master/LICENSE) PHPUnit toolbox with short assertion aliases and useful testing utilities. This library provides a more concise and readable way to write tests by offering shorter function names for common PHPUnit assertions. @@ -11,7 +19,7 @@ PHPUnit toolbox with short assertion aliases and useful testing utilities. This - **Extended assertions** - Additional assertions for emails, dates, amounts, file contents - **Environment detection** - Detect if running under TeamCity, Travis, PhpStorm - **Built-in utilities** - Tools for test organization and debugging -- **PHP 8.2+ support** - Modern PHP features and strict typing +- **PHP 8.3+ support** - Modern PHP features and strict typing ## Installation @@ -152,7 +160,7 @@ class PackageTest extends PHPUnit ## Requirements -- PHP 8.2 or higher +- PHP 8.3 or higher - PHPUnit ^9.6.29 - ext-filter, ext-mbstring diff --git a/composer.json b/composer.json index 950bd30..77887be 100644 --- a/composer.json +++ b/composer.json @@ -26,21 +26,21 @@ "prefer-stable" : true, "require" : { - "php" : "^8.2", + "php" : "^8.3", "ext-filter" : "*", "ext-mbstring" : "*", "phpunit/phpunit" : "^11.5.41", "ulrichsg/getopt-php" : ">=4.0.4", - "jbzoo/markdown" : "^7.0.1" + "jbzoo/markdown" : "^8.0" }, "require-dev" : { - "jbzoo/toolbox-dev" : "^7.1", - "jbzoo/codestyle" : "^7.1.6", - "jbzoo/http-client" : "^7.1", - "jbzoo/data" : "^7.1", - "jbzoo/utils" : "^7.2", + "jbzoo/toolbox-dev" : "^8.0", + "jbzoo/codestyle" : "^8.0", + "jbzoo/data" : "^8.0", + "jbzoo/utils" : "^8.0", + "jbzoo/http-client" : "^8.0", "guzzlehttp/guzzle" : ">=7.10.0", "symfony/process" : ">=7.3.4" @@ -66,7 +66,7 @@ "extra" : { "branch-alias" : { - "dev-master" : "7.x-dev" + "dev-master" : "8.x-dev" } } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 930818b..5d5d26f 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -10,16 +10,8 @@ @copyright Copyright (C) JBZoo.com, All rights reserved. @see https://github.com/JBZoo/PHPUnit --> - - - - src - + + @@ -37,4 +29,10 @@ + + + + src + + diff --git a/src/fake-index.php b/src/fake-index.php index 0a9899d..2a5393f 100644 --- a/src/fake-index.php +++ b/src/fake-index.php @@ -77,7 +77,7 @@ $cliOptions->process(Env::string('PHPUNINT_ARGUMENTS')); -$realIndex = (string)($realIndex ?? \realpath($cliOptions->getOption('index'))); +$realIndex = (string)($realIndex ?? \realpath((string)$cliOptions->getOption('index'))); if (\class_exists(CovCatcher::class) && Sys::hasXdebug()) { $testname = (string)data($_REQUEST)->get('testname'); diff --git a/src/functions/aliases.php b/src/functions/aliases.php index 426e862..89ff157 100644 --- a/src/functions/aliases.php +++ b/src/functions/aliases.php @@ -78,12 +78,10 @@ function isFalse(mixed $value, string $message = ''): void } /** - * @param string $expected - * @param mixed $className + * @param class-string $expected + * @param mixed $className * - * @psalm-template ExpectedType of object - * @psalm-param class-string $expected - * @phan-suppress PhanPluginCanUseParamType + * @phan-suppress PhanPluginCanUseParamType */ function isClass($expected, $className, string $message = ''): void {