From 162f3d2af049d6646fc912c52819254dfc26658d Mon Sep 17 00:00:00 2001 From: Nick Harin Date: Wed, 8 Jul 2026 01:23:43 +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 954dc01..26abd52 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,3 +35,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