Page MenuHomeDevCentral

Upgrade tests to PHPUnit 12
ClosedPublic

Authored by dereckson on Oct 18 2025, 13:08.
Tags
None
Referenced Files
F21124765: D3760.diff
Fri, Jan 16, 11:16
Unknown Object (File)
Fri, Jan 16, 08:37
Unknown Object (File)
Fri, Jan 16, 08:28
Unknown Object (File)
Wed, Jan 14, 22:10
Unknown Object (File)
Tue, Jan 13, 06:31
Unknown Object (File)
Fri, Jan 9, 01:13
Unknown Object (File)
Thu, Jan 8, 08:56
Unknown Object (File)
Mon, Jan 5, 12:37
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.