From ed8694f89eb7702eb7e617af29f8f444f32b8d3c Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 12 Aug 2026 02:05:03 +0900 Subject: test(installed-versions): verify the PHP class the worker loads InstalledVersions has no Rust port, so the skeletons left behind asserted nothing about compatibility. The tests now require the Composer checkout's vendor/autoload.php into the PHP worker and drive the real class there, which puts $selfDir, the registered ClassLoader and Composer\Semver\VersionParser in the same state as the upstream PHPUnit run. The upstream setUp reflection and the installed_relative.php require stay in PHP; the expected values are Rust. The class Composer's own vendor directory autoloads and the one FilesystemRepository::write dumps from include_str! are separate files, so an added test asserts they hold the same bytes. FilesystemRepositoryTest::testSafelyLoadInstalledVersions moves to the worker too, against the php/stubs FilesystemRepository, whose safelyLoadInstalledVersions runs the PCRE recursive grammar natively. The shared worker helpers live in tests/common/php_worker.rs. Co-Authored-By: Claude Opus 5 (1M context) --- crates/shirabe/tests/repository/main.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'crates/shirabe/tests/repository/main.rs') diff --git a/crates/shirabe/tests/repository/main.rs b/crates/shirabe/tests/repository/main.rs index e86772e7..cf15d27b 100644 --- a/crates/shirabe/tests/repository/main.rs +++ b/crates/shirabe/tests/repository/main.rs @@ -6,6 +6,8 @@ mod config_stub; mod http_downloader_mock; #[path = "../common/io_stub.rs"] mod io_stub; +#[path = "../common/php_worker.rs"] +mod php_worker; #[path = "../common/process_executor_mock.rs"] mod process_executor_mock; #[path = "../common/test_case.rs"] -- cgit v1.3.1-4-g156e