aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/util/remote_filesystem.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-25 16:44:29 +0900
committernsfisis <nsfisis@gmail.com>2026-06-26 00:20:05 +0900
commitf5f429dbae0a3e2d8224c0b1e4edcef54805d286 (patch)
tree9f837baeeae6efa0ed926b181b8c273128d86c49 /crates/shirabe/src/util/remote_filesystem.rs
parent3a0d9340810a8808d963135a884f50d08442ac67 (diff)
downloadphp-shirabe-f5f429dbae0a3e2d8224c0b1e4edcef54805d286.tar.gz
php-shirabe-f5f429dbae0a3e2d8224c0b1e4edcef54805d286.tar.zst
php-shirabe-f5f429dbae0a3e2d8224c0b1e4edcef54805d286.zip
feat(http): reimplement CurlDownloader on reqwest; port 15 more tests
Replace the libcurl-shim CurlDownloader with a reqwest+tokio implementation per the .ken sketch, resolving the construction panic that blocked command tests (mock path via __new_mock is untouched). Port remote_filesystem (7), hg/svn driver (4), zip_archiver/git_exclude_filter (4) tests. Fix hg/svn/git_exclude regex-delimiter and svn result-propagation porting bugs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/util/remote_filesystem.rs')
-rw-r--r--crates/shirabe/src/util/remote_filesystem.rs57
1 files changed, 57 insertions, 0 deletions
diff --git a/crates/shirabe/src/util/remote_filesystem.rs b/crates/shirabe/src/util/remote_filesystem.rs
index 2a15cf0..5bd9036 100644
--- a/crates/shirabe/src/util/remote_filesystem.rs
+++ b/crates/shirabe/src/util/remote_filesystem.rs
@@ -1031,4 +1031,61 @@ impl RemoteFilesystem {
fn normalize_result(&self, result: Option<&str>) -> Option<String> {
result.map(|s| s.to_string())
}
+
+ /// For testing only. Invokes the private `get_options_for_url`, mirroring the
+ /// `ReflectionMethod` access in `RemoteFilesystemTest::callGetOptionsForUrl`.
+ pub fn __get_options_for_url(
+ &mut self,
+ origin_url: &str,
+ additional_options: IndexMap<String, PhpMixed>,
+ ) -> IndexMap<String, PhpMixed> {
+ self.get_options_for_url(origin_url, additional_options)
+ }
+
+ /// For testing only. Sets the private `file_url`, mirroring the
+ /// `ReflectionProperty` access in `RemoteFilesystemTest::callGetOptionsForUrl`.
+ pub fn __set_file_url(&mut self, file_url: &str) {
+ self.file_url = file_url.to_string();
+ }
+
+ /// For testing only. Invokes the private `callback_get`, mirroring the
+ /// `ReflectionMethod` access in `RemoteFilesystemTest::callCallbackGet`.
+ pub fn __callback_get(
+ &mut self,
+ notification_code: i64,
+ severity: i64,
+ message: Option<String>,
+ message_code: i64,
+ bytes_transferred: i64,
+ bytes_max: i64,
+ ) -> anyhow::Result<()> {
+ self.callback_get(
+ notification_code,
+ severity,
+ message,
+ message_code,
+ bytes_transferred,
+ bytes_max,
+ )
+ }
+
+ /// For testing only. Reads the private `bytes_max`.
+ pub fn __bytes_max(&self) -> i64 {
+ self.bytes_max
+ }
+
+ /// For testing only. Sets the private `bytes_max`.
+ pub fn __set_bytes_max(&mut self, bytes_max: i64) {
+ self.bytes_max = bytes_max;
+ }
+
+ /// For testing only. Sets the private `progress`.
+ pub fn __set_progress(&mut self, progress: bool) {
+ self.progress = progress;
+ }
+
+ /// For testing only. Reads the private `last_progress`.
+ pub fn __last_progress(&self) -> Option<i64> {
+ self.last_progress
+ }
}