aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/tests/installed_versions_test.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/tests/installed_versions_test.rs')
-rw-r--r--crates/shirabe/tests/installed_versions_test.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/crates/shirabe/tests/installed_versions_test.rs b/crates/shirabe/tests/installed_versions_test.rs
index 9b81c3c8..b8c65485 100644
--- a/crates/shirabe/tests/installed_versions_test.rs
+++ b/crates/shirabe/tests/installed_versions_test.rs
@@ -512,12 +512,19 @@ fn test_worker_loads_the_installed_versions_file_shirabe_dumps() {
let _worker = lock_php_worker();
load_composer_php_runtime();
+ // Read in the worker rather than from Rust: the file it autoloads lives inside the runtime
+ // bundle, which only the PHP side has a stream wrapper for.
let loaded = string_of(&php_eval(
r"return (new \ReflectionClass(\Composer\InstalledVersions::class))->getFileName();",
));
+ let contents = string_of(&php_eval(
+ r"return file_get_contents(
+ (new \ReflectionClass(\Composer\InstalledVersions::class))->getFileName()
+ );",
+ ));
assert_eq!(
include_str!("../../../composer/src/Composer/InstalledVersions.php"),
- std::fs::read_to_string(&loaded).unwrap(),
+ contents,
"the worker autoloads {loaded}, which must match the file Shirabe dumps",
);
}