diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 39366d5..b595422 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: matrix: prefer_lowest: ["", "--prefer-lowest"] container: - image: skpr/php-cli:8.3-dev-v2-latest + image: skpr/php-cli:8.4-dev-v2-latest options: --pull always --user 1001:1001 @@ -31,7 +31,7 @@ jobs: - name: 🧹 PHPCS run: ./bin/phpcs --report=checkstyle -q | ./bin/cs2pr - name: 🧹 PHPStan - run: ./bin/phpstan --error-format=github analyse + run: ./bin/phpstan --error-format=github analyse -v - name: ⚡ Run Tests run: ./bin/phpunit --log-junit phpunit-results.xml - name: 📝 Publish Test Results diff --git a/composer.json b/composer.json index 6dac852..900673f 100644 --- a/composer.json +++ b/composer.json @@ -1,31 +1,35 @@ { "name": "previousnext/phpunit-splitter", "description": "Splits phpunit tests", - "keywords": ["testing"], + "keywords": ["testing", "phpunit"], "license": "GPL-2.0-or-later", "authors": [ { "name": "Michael Strelan", "email": "michael.strelan@previousnext.com.au" + }, + { + "name": "Kim Pepper", + "email": "kim@previousnext.com.au" } ], "type": "project", "require": { "php": "^8.1", "ext-simplexml": "*", - "symfony/console": "^6.3|^7.0" + "phpstan/phpstan-deprecation-rules": "^1.2", + "phpstan/phpstan-phpunit": "^1.4", + "symfony/console": "^6.3|^7.2" }, "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^1.0", - "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^9.6", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^1.12.19", + "phpunit/phpunit": "^10.5.45", "previousnext/coding-standard": "^1.1.1", "staabm/annotate-pull-request-from-checkstyle": "^1.8" }, - "bin" : ["phpunit-splitter"], - "conflict": { - "drupal/coder": "<8.3.21" - }, + "bin": ["phpunit-splitter"], "autoload": { "psr-4": {"PhpUnitSplitter\\": "src/"} }, @@ -39,7 +43,22 @@ "sort-packages": true, "bin-dir": "bin", "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true + "dealerdirect/phpcodesniffer-composer-installer": true, + "phpstan/extension-installer": true } + }, + "scripts": { + "phpcs": [ + "phpcs" + ], + "phpcbf": [ + "phpcbf" + ], + "phpstan": [ + "phpstan analyse --no-progress -v" + ], + "phpunit": [ + "phpunit" + ] } } diff --git a/phpunit.xml b/phpunit.xml index 6b63806..1f1f01e 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,27 +1,23 @@ + requireCoverageMetadata="true" + beStrictAboutCoverageMetadata="true" +> tests/src - - + src - + diff --git a/src/GlobbingTestResultCache.php b/src/GlobbingTestResultCache.php index 932d0d0..2602f65 100644 --- a/src/GlobbingTestResultCache.php +++ b/src/GlobbingTestResultCache.php @@ -48,7 +48,7 @@ public function __construct( * {@inheritdoc} */ public function getState(string $testName): int { - return $this->defects[$testName] ?? TestStatus::UNKNOWN->getValue(); + return $this->defects[$testName] ?? TestStatus::Unknown->getValue(); } /** diff --git a/src/TestStatus.php b/src/TestStatus.php index 94d6e7f..1fb5b87 100644 --- a/src/TestStatus.php +++ b/src/TestStatus.php @@ -9,14 +9,14 @@ */ enum TestStatus: int { - case UNKNOWN = -1; - case PASSED = 0; - case SKIPPED = 1; - case INCOMPLETE = 2; - case FAILURE = 3; - case ERROR = 4; - case RISKY = 5; - case WARNING = 6; + case Unknown = -1; + case Passed = 0; + case Skipped = 1; + case Incomplete = 2; + case Failure = 3; + case Error = 4; + case Risky = 5; + case Warning = 6; /** * Get the status value.