Skip to content

Migrate test suite to Pest with 100% code coverage - #61

Merged
atmonshi merged 1 commit into
mainfrom
chore/migrate-to-pest
Nov 29, 2026
Merged

atmonshi merged 1 commit into
mainfrom
chore/migrate-to-pest

Conversation

@atmonshi

Copy link
Copy Markdown
Member

Summary

Migrates the test suite from PHPUnit to Pest (pestphp/pest ^3.0|^4.0) and expands test coverage to 100.0% across all source files.

Changes

  • Pest setup (composer.json, tests/TestCase.php, tests/Pest.php, .github/workflows/run-tests.yml):
    • Replaced direct phpunit/phpunit dev requirement with pestphp/pest: ^3.0|^4.0 and allowed pestphp/pest-plugin.
    • Updated Composer test / test-coverage scripts and CI workflow to run vendor/bin/pest.
    • Added shared Orchestra Testbench tests/TestCase.php and tests/Pest.php bootstrap.
  • Migrated & expanded tests (tests/ExampleTest.php, tests/arPhpTest.php):
    • Migrated all 22 existing tests 1-to-1 to Pest it(...) and expect(...) syntax.
    • Added 6 additional tests covering en2ar(), ar2en(), strtotime(), arSummary(), ArPhpLaravelFacade, Eloquent orderAr(), SearchAr::scopeSearchAr(), empty field validation, punctuation-only tokens, and custom query builders without a grammar.
  • Cleanup (src/Macroables.php):
    • Simplified preg_split() and extractWordPatterns() to remove unreachable branches and strip stray quotes before lexical extraction.

Verification

  • ./vendor/bin/pest --coverage --min=100: 28 passed (52 assertions), 100.0% coverage
  • ./vendor/bin/phpstan analyse: 0 errors
  • ./vendor/bin/pint --test: passed
  • composer validate --strict & composer audit: valid, 0 advisories

@atmonshi
atmonshi merged commit a54ee88 into main Nov 29, 2026
5 checks passed
@atmonshi
atmonshi deleted the chore/migrate-to-pest branch November 29, 2026 09:05
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