From 1202de76360a54d2857c1a55f0ec6afb90073883 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Fri, 9 Oct 2026 23:53:10 +0400 Subject: [PATCH 1/2] feat: require PHP 8.2 build: bump vimeo/psalm to ^6 || ^7 Testo needs PHP 8.2. Psalm 6 reports MissingOverrideAttribute (a PHP 8.3 attribute) and ClassMustBeFinal across the codebase; both are suppressed in psalm.xml until the static analysis pass, and a stale baseline entry is dropped. Assisted-By: Claude Opus 5.5 --- composer.json | 4 ++-- psalm-baseline.xml | 3 --- psalm.xml | 3 +++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 3989185..e3535b4 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ } ], "require": { - "php": ">=8.1", + "php": ">=8.2", "ext-json": "*", "composer/semver": "^3.4", "spiral/roadrunner-worker": "^2 || ^3", @@ -42,7 +42,7 @@ "jetbrains/phpstorm-attributes": "^1.2", "spiral/code-style": "^2.3.1", "spiral/dumper": "^3.3", - "vimeo/psalm": "^6.0" + "vimeo/psalm": "^6 || ^7" }, "autoload": { "psr-4": { diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 4a22a52..80eff43 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -145,9 +145,6 @@ stability->get($input, $io)]]> - - getAssets()]]> - diff --git a/psalm.xml b/psalm.xml index c729c68..e275989 100644 --- a/psalm.xml +++ b/psalm.xml @@ -16,6 +16,9 @@ > + + + From 22c3ea1ddb2e09b8314e620a00776129a0ff3756 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Fri, 9 Oct 2026 23:54:27 +0400 Subject: [PATCH 2/2] test: set up Testo ci: run tests via the shared testo workflow The package had no test suite; a Stability smoke test gives the new suite something to run until the coverage pass. Assisted-By: Claude Opus 5.5 --- .github/workflows/testo.yml | 14 +++++++ .php-cs-fixer.dist.php | 1 + composer.json | 9 ++++- testo.php | 16 ++++++++ tests/Unit/Environment/StabilityTest.php | 48 ++++++++++++++++++++++++ 5 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/testo.yml create mode 100644 testo.php create mode 100644 tests/Unit/Environment/StabilityTest.php diff --git a/.github/workflows/testo.yml b/.github/workflows/testo.yml new file mode 100644 index 0000000..0fc9997 --- /dev/null +++ b/.github/workflows/testo.yml @@ -0,0 +1,14 @@ +on: + pull_request: null + push: + branches: + - '2.x' + +name: testo + +jobs: + testo: + uses: spiral/gh-actions/.github/workflows/testo.yml@master + with: + os: >- + ['ubuntu-latest'] diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 5d04cfb..8143b8e 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -7,6 +7,7 @@ return \Spiral\CodeStyle\Builder::create() ->include(__DIR__ . '/bin/rr') ->include(__DIR__ . '/src') + ->include(__DIR__ . '/tests') ->include(__FILE__) ->cache('./runtime/php-cs-fixer.cache') ->allowRisky(false) diff --git a/composer.json b/composer.json index e3535b4..00093be 100644 --- a/composer.json +++ b/composer.json @@ -42,6 +42,7 @@ "jetbrains/phpstorm-attributes": "^1.2", "spiral/code-style": "^2.3.1", "spiral/dumper": "^3.3", + "testo/testo": "^0.10.55", "vimeo/psalm": "^6 || ^7" }, "autoload": { @@ -49,11 +50,17 @@ "Spiral\\RoadRunner\\Console\\": "src" } }, + "autoload-dev": { + "psr-4": { + "Spiral\\RoadRunner\\Console\\Tests\\": "tests" + } + }, "scripts": { "cs:diff": "php-cs-fixer fix --dry-run -v --diff", "cs:fix": "php-cs-fixer fix -v", "psalm": "psalm", - "psalm:baseline": "psalm --set-baseline=psalm-baseline.xml" + "psalm:baseline": "psalm --set-baseline=psalm-baseline.xml", + "test": "vendor/bin/testo" }, "config": { "sort-packages": true, diff --git a/testo.php b/testo.php new file mode 100644 index 0000000..0320172 --- /dev/null +++ b/testo.php @@ -0,0 +1,16 @@ + 'stable', + 'STABILITY_RC' => 'RC', + 'STABILITY_BETA' => 'beta', + 'STABILITY_ALPHA' => 'alpha', + 'STABILITY_DEV' => 'dev', + ]); + } + + public function weightsFollowStabilityOrder(): void + { + Assert::true(Stability::toInt(Stability::STABILITY_STABLE) > Stability::toInt(Stability::STABILITY_RC)); + Assert::true(Stability::toInt(Stability::STABILITY_RC) > Stability::toInt(Stability::STABILITY_BETA)); + Assert::true(Stability::toInt(Stability::STABILITY_BETA) > Stability::toInt(Stability::STABILITY_ALPHA)); + Assert::true(Stability::toInt(Stability::STABILITY_ALPHA) > Stability::toInt(Stability::STABILITY_DEV)); + } + + public function unknownStabilityWeighsAsDev(): void + { + Assert::same(Stability::toInt('unknown'), Stability::toInt(Stability::STABILITY_DEV)); + } + + #[DataSet(['stable', true])] + #[DataSet(['RC', true])] + #[DataSet(['dev', true])] + #[DataSet(['rc', false], 'case-sensitive')] + #[DataSet(['', false], 'empty')] + public function isValid(string $value, bool $expected): void + { + Assert::same(Stability::isValid($value), $expected); + } +}