aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/tests/repository/main.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-12 02:05:03 +0900
committernsfisis <nsfisis@gmail.com>2026-08-12 02:05:03 +0900
commited8694f89eb7702eb7e617af29f8f444f32b8d3c (patch)
treeeb140dc918445f325c92618cfabb8094b53ccd55 /crates/shirabe/tests/repository/main.rs
parent3e2613f70ebdb441269556d1080a69a1f21a4f7d (diff)
downloadphp-shirabe-ed8694f89eb7702eb7e617af29f8f444f32b8d3c.tar.gz
php-shirabe-ed8694f89eb7702eb7e617af29f8f444f32b8d3c.tar.zst
php-shirabe-ed8694f89eb7702eb7e617af29f8f444f32b8d3c.zip
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) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/tests/repository/main.rs')
-rw-r--r--crates/shirabe/tests/repository/main.rs2
1 files changed, 2 insertions, 0 deletions
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"]