Page MenuHomeDevCentral

Upgrade tests to PHPUnit 12
ClosedPublic

Authored by dereckson on Oct 18 2025, 13:08.
Tags
None
Referenced Files
F19358881: D3760.id.diff
Sat, Dec 27, 13:05
F19355226: D3760.id9740.diff
Sat, Dec 27, 10:28
F19338383: D3760.id9740.diff
Sat, Dec 27, 00:08
F19337815: D3760.id9741.diff
Fri, Dec 26, 23:51
Unknown Object (File)
Fri, Dec 26, 17:56
Unknown Object (File)
Fri, Dec 26, 13:41
Unknown Object (File)
Fri, Dec 26, 13:31
Unknown Object (File)
Fri, Dec 26, 12:41
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
Lint Not Applicable
Unit
Tests Not Applicable

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.