Skip to content

Support PHPUnit 10+ and count assertions - #62

Merged
danog merged 2 commits into
psalm:masterfrom
danog:phpunit-10
Oct 20, 2026
Merged

danog merged 2 commits into
psalm:masterfrom
danog:phpunit-10

Conversation

@danog

@danog danog commented Oct 20, 2026

Copy link
Copy Markdown
Member

Skipped steps throw PHPUnit\Framework\SkippedTestError, which no longer exists in PHPUnit 10+, and passing steps aren't counted as assertions.

Before:

Error: Class "PHPUnit\Framework\SkippedTestError" not found
...
OK (19 tests, 0 assertions)

After:

Assert::markTestSkipped("This scenario requires Psalm $op $version because of $reason");
// OK (19 tests, 33 assertions), on PHPUnit 9.6, 10.5, 11.5 and 12.5

https://claude.ai/code/session_01WNSb29tptiTQoc44Tk7XZW

danog added 2 commits October 20, 2026 10:50
Skip scenarios with Assert::markTestSkipped() instead of throwing
PHPUnit\Framework\SkippedTestError, which was removed in PHPUnit 10.

Make the see* steps use PHPUnit assertions so that Codeception counts
them; previously only failures were recorded, so passing runs reported
"Assertions: 0".

Allow PHPUnit 10-12 and Psalm 7 in dev dependencies, run CI on
ubuntu-latest with PHP up to 8.4, and adjust the fixtures for Psalm 7's
purity checks.

Claude-Session: https://claude.ai/code/session_01WNSb29tptiTQoc44Tk7XZW
The lowest allowed Psalm versions crash on PHP 8.4.

Claude-Session: https://claude.ai/code/session_01WNSb29tptiTQoc44Tk7XZW
@danog danog closed this Oct 20, 2026
@danog danog reopened this Oct 20, 2026
@danog
danog merged commit faf4fec into psalm:master Oct 20, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant