Page MenuHomeDevCentral

Upgrade tests to PHPUnit 12
ClosedPublic

Authored by dereckson on Oct 18 2025, 13:08.
Tags
None
Referenced Files
F48851307: D3760.id9741.diff
Wed, Sep 9, 01:26
F48826662: D3760.id.diff
Tue, Sep 8, 21:10
F48804671: D3760.id9740.diff
Tue, Sep 8, 17:13
Unknown Object (File)
Tue, Sep 1, 19:55
Unknown Object (File)
Sat, Aug 29, 01:03
Unknown Object (File)
Sat, Aug 29, 00:06
Unknown Object (File)
Fri, Aug 28, 15:22
Unknown Object (File)
Fri, Aug 28, 15:06
Subscribers
None

Details

Summary

Tests are now organized in a namespace Waystone\Workspaces\Tests,
each class, trait or interface in a dedicated file to follow PSR-4.

Coverage is defined by attributes.

Exceptions are directly handled by PHPUnit assert methods.

Tests can be run from:

  • the tests/ folder, as before
  • the repository root, with the new /phpunit.xml

A tests bootstrap script allows to load Composer dependencies
from the vendor/ directory at workspaces level or monorepo level.

Test Plan
  • Top-level: phpunit
  • Tests-level: (cd workspaces/tests && make test)

Diff Detail

Repository
rOBSIDIAN Obsidian Workspaces
Lint
No Lint Coverage
Unit
Test Failures
Branch
main
Build Status
Buildable 6025
Build 6309: arc lint + arc unit

Event Timeline

dereckson created this revision.

arc unit has a problem to load phpunit.xml it seems. If I remember well, it runs a test file directly, but in that case, PHPUnit can detect local configuration.

Workstation
$ phpunit workspaces/tests/Engines/Collection/SQLiteCollectionTest.php
Switching to Composer phpunit:
PHPUnit 12.5-dev by Sebastian Bergmann and contributors.

Runtime:       PHP 8.4.13
Configuration: /Users/ssantoro/dev/nasqueron/obsidian/phpunit.xml

D...D.                                                              6 / 6 (100%)
[...]

Note the Configuration line to point to the actually loaded PHPUnit configuration file.

This revision is now accepted and ready to land.Oct 18 2025, 13:33
This revision was automatically updated to reflect the committed changes.