From d6780bf53333e1d35ef104cb5f2244ef8f68ebc1 Mon Sep 17 00:00:00 2001 From: Nick Harin Date: Wed, 8 Jul 2026 01:32:35 +0500 Subject: [PATCH] Reject native test assertions in CI Fail the build if tests use PHPUnit assert*/expectException instead of fluent fact()/throws(). --- .github/workflows/ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1b5575..41f2ed8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,3 +68,11 @@ jobs: - name: Pint (dry-run) run: vendor/bin/pint --test + + - name: No native assertions in tests + run: | + dir=tests; [ -d "$dir" ] || dir=Tests + if grep -rnE '(self::|static::|\$this->|Assert::)assert[A-Za-z]*\(|->expectException' "$dir" 2>/dev/null; then + echo "::error::Tests must use fluent fact()/throws(), not native PHPUnit assertions." + exit 1 + fi