Skip to content

Migrate tests from PHPUnit to Testo - #9

Merged
rasuvaeff merged 3 commits into
masterfrom
migrate/tests-to-testo
Jun 26, 2026
Merged

Migrate tests from PHPUnit to Testo#9
rasuvaeff merged 3 commits into
masterfrom
migrate/tests-to-testo

Conversation

@rasuvaeff

Copy link
Copy Markdown
Owner

Summary

  • Replace phpunit/phpunit with testo/testo + testo/bridge-infection across all Unit and Integration tests
  • Delete phpunit.xml.dist; add testo.php with Unit + Integration suite configs
  • Convert 14 Unit test files and SqliteIntegrationTest: extends TestCase#[Test] on class, #[Covers]/#[CoversNothing], Assert::same(actual, expected), Expect::exception()
  • Replace all createMock() calls with hand-crafted stubs: FakeConnection (ConnectionInterface stub for query-building tests), FakeVisitor (SpecificationVisitor spy), FakeSpecification (minimal Specification stub)
  • QueryBuildingVisitorTest and QueryApplierTest: replace mock QueryInterface with real Query(db: new FakeConnection()) + structural verification via getWhere(), getOrderBy(), getParams()

Test plan

  • composer build exits 0 — 247 tests (230 Unit + 17 Integration), 568 assertions, all passed
  • Psalm: No errors found
  • CS: 0 files to fix
  • SqliteIntegrationTest — 17 real SQLite queries, all green

Replace phpunit/phpunit with testo/testo + testo/bridge-infection.
Delete phpunit.xml.dist, add testo.php (Unit + Integration suites).
Replace all extends TestCase / createMock() with:
  - #[Test] on class, #[Covers] / #[CoversNothing]
  - Hand-crafted FakeConnection / FakeVisitor / FakeSpecification stubs
  - Assert::same(actual, expected), Expect::exception()
  - Real Query(db: new FakeConnection()) for structural verification

247 tests (230 Unit + 17 Integration), 568 assertions, composer build green.
@rasuvaeff
rasuvaeff merged commit f238bd9 into master Jun 26, 2026
7 checks passed
@rasuvaeff
rasuvaeff deleted the migrate/tests-to-testo branch June 26, 2026 15:36
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