diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-25 15:12:06 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-26 00:20:05 +0900 |
| commit | 8117e5450693d19726da877bce8aacf5c7aa53af (patch) | |
| tree | 4b06e6f6924599f3402d29cdcdeb0f8a88354d89 /crates/shirabe/tests/common | |
| parent | 8dd3d67884a204ca40e3364206868fea77a312be (diff) | |
| download | php-shirabe-8117e5450693d19726da877bce8aacf5c7aa53af.tar.gz php-shirabe-8117e5450693d19726da877bce8aacf5c7aa53af.tar.zst php-shirabe-8117e5450693d19726da877bce8aacf5c7aa53af.zip | |
test: port 44 vcs/downloader/version tests using mock infra
Port git, version_guesser, gitlab_driver, github_driver, and git_downloader
tests using the ProcessExecutor/HttpDownloader mocks and IO/Config stubs.
Fix production regex-porting bugs surfaced by the now-reachable paths:
Url::sanitize and Response::find_header_value had non-delimited PCRE patterns;
implement array_search_mixed non-strict branch and a datetime format mapping.
Add HttpDownloader::__new_mock so mocked downloaders skip curl construction.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/tests/common')
| -rw-r--r-- | crates/shirabe/tests/common/http_downloader_mock.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/crates/shirabe/tests/common/http_downloader_mock.rs b/crates/shirabe/tests/common/http_downloader_mock.rs index 249585c..7a021f9 100644 --- a/crates/shirabe/tests/common/http_downloader_mock.rs +++ b/crates/shirabe/tests/common/http_downloader_mock.rs @@ -64,12 +64,7 @@ pub fn get_http_downloader_mock( ) -> (Rc<RefCell<HttpDownloader>>, HttpDownloaderMockGuard) { let io: Rc<RefCell<dyn IOInterface>> = Rc::new(RefCell::new(NullIO::new())); let config = Rc::new(RefCell::new(Config::new(false, None))); - let downloader = Rc::new(RefCell::new(HttpDownloader::new( - io, - config, - IndexMap::new(), - false, - ))); + let downloader = Rc::new(RefCell::new(HttpDownloader::__new_mock(io, config))); downloader .borrow_mut() .__expects(expectations, strict, default_handler); |
