diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-21 04:30:31 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-21 04:30:31 +0900 |
| commit | d02e79c0cddd986a0b2cef878f32bda39cc2f5e9 (patch) | |
| tree | 43e2256ae239aa005d31bc9505a507b4d303ab17 /crates/shirabe/tests/downloader | |
| parent | d2babe9ed19a40dca2790b3eeaff0b0de9714451 (diff) | |
| download | php-shirabe-d02e79c0cddd986a0b2cef878f32bda39cc2f5e9.tar.gz php-shirabe-d02e79c0cddd986a0b2cef878f32bda39cc2f5e9.tar.zst php-shirabe-d02e79c0cddd986a0b2cef878f32bda39cc2f5e9.zip | |
test: port SecurityAdvisoryPoolFilter, downloader/command/app stubs
All ignored/todo!(): the advisory filter parses affectedVersions via a
look-around regex; the Hg/Fossil/Perforce/Archive downloaders and
RepositoryManager need mocked process/HttpDownloader (curl); the Validate/
Archive commands, ApplicationTest and CompletionFunctionalTest need the
ApplicationTester/console harness. setUp/tearDown not ported.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/tests/downloader')
5 files changed, 151 insertions, 0 deletions
diff --git a/crates/shirabe/tests/downloader/archive_downloader_test.rs b/crates/shirabe/tests/downloader/archive_downloader_test.rs index 54ac321..2c0e2de 100644 --- a/crates/shirabe/tests/downloader/archive_downloader_test.rs +++ b/crates/shirabe/tests/downloader/archive_downloader_test.rs @@ -1 +1,41 @@ //! ref: composer/tests/Composer/Test/Downloader/ArchiveDownloaderTest.php + +// These exercise getFileName/processUrl on an anonymous ArchiveDownloader subclass built +// with a mocked IO and a real HttpDownloader (curl_multi_init is todo!()), and pass mocked +// packages. + +#[test] +#[ignore = "constructs an ArchiveDownloader (HttpDownloader reaches curl_multi_init, todo!()) with a mocked subclass/package"] +fn test_get_file_name() { + todo!() +} + +#[test] +#[ignore = "constructs an ArchiveDownloader (HttpDownloader reaches curl_multi_init, todo!()) with a mocked subclass/package"] +fn test_process_url() { + todo!() +} + +#[test] +#[ignore = "constructs an ArchiveDownloader (HttpDownloader reaches curl_multi_init, todo!()) with a mocked subclass/package"] +fn test_process_url2() { + todo!() +} + +#[test] +#[ignore = "constructs an ArchiveDownloader (HttpDownloader reaches curl_multi_init, todo!()) with a mocked subclass/package"] +fn test_process_url3() { + todo!() +} + +#[test] +#[ignore = "constructs an ArchiveDownloader (HttpDownloader reaches curl_multi_init, todo!()) with a mocked subclass/package"] +fn test_process_url_rewrite_dist() { + todo!() +} + +#[test] +#[ignore = "constructs an ArchiveDownloader (HttpDownloader reaches curl_multi_init, todo!()) with a mocked subclass/package"] +fn test_process_url_rewrite_bitbucket_dist() { + todo!() +} diff --git a/crates/shirabe/tests/downloader/fossil_downloader_test.rs b/crates/shirabe/tests/downloader/fossil_downloader_test.rs index 827d634..89e0a9d 100644 --- a/crates/shirabe/tests/downloader/fossil_downloader_test.rs +++ b/crates/shirabe/tests/downloader/fossil_downloader_test.rs @@ -1 +1,41 @@ //! ref: composer/tests/Composer/Test/Downloader/FossilDownloaderTest.php + +// Every case constructs a FossilDownloader with a mocked IO/Config and a mocked +// ProcessExecutor to feed fossil command output; a real HttpDownloader reaches +// curl_multi_init (todo!()), and ProcessExecutor mocking is not available. + +#[test] +#[ignore = "mocks ProcessExecutor/IO and needs an HttpDownloader (curl_multi_init todo!())"] +fn test_install_for_package_without_source_reference() { + todo!() +} + +#[test] +#[ignore = "mocks ProcessExecutor/IO and needs an HttpDownloader (curl_multi_init todo!())"] +fn test_install() { + todo!() +} + +#[test] +#[ignore = "mocks ProcessExecutor/IO and needs an HttpDownloader (curl_multi_init todo!())"] +fn test_updatefor_package_without_source_reference() { + todo!() +} + +#[test] +#[ignore = "mocks ProcessExecutor/IO and needs an HttpDownloader (curl_multi_init todo!())"] +fn test_update() { + todo!() +} + +#[test] +#[ignore = "mocks ProcessExecutor/IO and needs an HttpDownloader (curl_multi_init todo!())"] +fn test_remove() { + todo!() +} + +#[test] +#[ignore = "mocks ProcessExecutor/IO and needs an HttpDownloader (curl_multi_init todo!())"] +fn test_get_installation_source() { + todo!() +} diff --git a/crates/shirabe/tests/downloader/hg_downloader_test.rs b/crates/shirabe/tests/downloader/hg_downloader_test.rs index bf08c1a..23c09f9 100644 --- a/crates/shirabe/tests/downloader/hg_downloader_test.rs +++ b/crates/shirabe/tests/downloader/hg_downloader_test.rs @@ -1 +1,41 @@ //! ref: composer/tests/Composer/Test/Downloader/HgDownloaderTest.php + +// Every case constructs an HgDownloader with a mocked IO/Config and a mocked +// ProcessExecutor to feed hg command output; a real HttpDownloader reaches +// curl_multi_init (todo!()), and ProcessExecutor mocking is not available. + +#[test] +#[ignore = "mocks ProcessExecutor/IO and needs an HttpDownloader (curl_multi_init todo!())"] +fn test_download_for_package_without_source_reference() { + todo!() +} + +#[test] +#[ignore = "mocks ProcessExecutor/IO and needs an HttpDownloader (curl_multi_init todo!())"] +fn test_download() { + todo!() +} + +#[test] +#[ignore = "mocks ProcessExecutor/IO and needs an HttpDownloader (curl_multi_init todo!())"] +fn test_updatefor_package_without_source_reference() { + todo!() +} + +#[test] +#[ignore = "mocks ProcessExecutor/IO and needs an HttpDownloader (curl_multi_init todo!())"] +fn test_update() { + todo!() +} + +#[test] +#[ignore = "mocks ProcessExecutor/IO and needs an HttpDownloader (curl_multi_init todo!())"] +fn test_remove() { + todo!() +} + +#[test] +#[ignore = "mocks ProcessExecutor/IO and needs an HttpDownloader (curl_multi_init todo!())"] +fn test_get_installation_source() { + todo!() +} diff --git a/crates/shirabe/tests/downloader/main.rs b/crates/shirabe/tests/downloader/main.rs index 97f2ee4..cf52ccd 100644 --- a/crates/shirabe/tests/downloader/main.rs +++ b/crates/shirabe/tests/downloader/main.rs @@ -1 +1,5 @@ +mod archive_downloader_test; +mod fossil_downloader_test; +mod hg_downloader_test; +mod perforce_downloader_test; mod xz_downloader_test; diff --git a/crates/shirabe/tests/downloader/perforce_downloader_test.rs b/crates/shirabe/tests/downloader/perforce_downloader_test.rs index 97f45ca..41ced48 100644 --- a/crates/shirabe/tests/downloader/perforce_downloader_test.rs +++ b/crates/shirabe/tests/downloader/perforce_downloader_test.rs @@ -1 +1,28 @@ //! ref: composer/tests/Composer/Test/Downloader/PerforceDownloaderTest.php + +// These mock Perforce, the repository config and a Package to drive PerforceDownloader's +// initialization and install paths; mocking is not available here. + +#[test] +#[ignore = "mocks Perforce/repository/Package; mocking is not available"] +fn test_init_perforce_instantiates_a_new_perforce_object() { + todo!() +} + +#[test] +#[ignore = "mocks Perforce/repository/Package; mocking is not available"] +fn test_init_perforce_does_nothing_if_perforce_already_set() { + todo!() +} + +#[test] +#[ignore = "mocks Perforce/repository/Package; mocking is not available"] +fn test_do_install_with_tag() { + todo!() +} + +#[test] +#[ignore = "mocks Perforce/repository/Package; mocking is not available"] +fn test_do_install_with_no_tag() { + todo!() +} |
