diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-21 03:47:19 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-21 03:47:19 +0900 |
| commit | 41c80058ad57143b2ab23d2eb241983627de9da1 (patch) | |
| tree | 408cd7c8a4a853e744c8159e6743f7044edb3f20 /crates | |
| parent | 0e92f06a6a6e327f83966e36c3d884eba12b4192 (diff) | |
| download | php-shirabe-41c80058ad57143b2ab23d2eb241983627de9da1.tar.gz php-shirabe-41c80058ad57143b2ab23d2eb241983627de9da1.tar.zst php-shirabe-41c80058ad57143b2ab23d2eb241983627de9da1.zip | |
test: port Documentation/Xz/Audit/ErrorHandler/PharArchiver tests as stubs
All ignored/todo!(): they need infrastructure not yet ported (console
Application, HttpDownloader/curl, ApplicationTester, PHP runtime error
handler, PharData/ZipArchive). Wires up the downloader test target.
setUp/tearDown not ported.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/shirabe/tests/command/audit_command_test.rs | 24 | ||||
| -rw-r--r-- | crates/shirabe/tests/command/main.rs | 1 | ||||
| -rw-r--r-- | crates/shirabe/tests/documentation_test.rs | 6 | ||||
| -rw-r--r-- | crates/shirabe/tests/downloader/main.rs | 1 | ||||
| -rw-r--r-- | crates/shirabe/tests/downloader/xz_downloader_test.rs | 6 | ||||
| -rw-r--r-- | crates/shirabe/tests/package/archiver/mod.rs | 1 | ||||
| -rw-r--r-- | crates/shirabe/tests/package/archiver/phar_archiver_test.rs | 12 | ||||
| -rw-r--r-- | crates/shirabe/tests/util/error_handler_test.rs | 23 | ||||
| -rw-r--r-- | crates/shirabe/tests/util/main.rs | 1 |
9 files changed, 75 insertions, 0 deletions
diff --git a/crates/shirabe/tests/command/audit_command_test.rs b/crates/shirabe/tests/command/audit_command_test.rs index fd18db1..4972793 100644 --- a/crates/shirabe/tests/command/audit_command_test.rs +++ b/crates/shirabe/tests/command/audit_command_test.rs @@ -1 +1,25 @@ //! ref: composer/tests/Composer/Test/Command/AuditCommandTest.php + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_successful_response_code_when_no_packages_are_required() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_error_auditing_lock_file_when_it_is_missing() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_audit_package_with_no_security_vulnerabilities() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_audit_package_with_no_dev_option_passed() { + todo!() +} diff --git a/crates/shirabe/tests/command/main.rs b/crates/shirabe/tests/command/main.rs index f8aef08..fd40768 100644 --- a/crates/shirabe/tests/command/main.rs +++ b/crates/shirabe/tests/command/main.rs @@ -1,4 +1,5 @@ mod about_command_test; +mod audit_command_test; mod clear_cache_command_test; mod diagnose_command_test; mod exec_command_test; diff --git a/crates/shirabe/tests/documentation_test.rs b/crates/shirabe/tests/documentation_test.rs index d341a93..9ea9d37 100644 --- a/crates/shirabe/tests/documentation_test.rs +++ b/crates/shirabe/tests/documentation_test.rs @@ -1 +1,7 @@ //! ref: composer/tests/Composer/Test/DocumentationTest.php + +#[test] +#[ignore = "requires the console Application and Symfony ApplicationDescription to enumerate commands, which are not yet ported"] +fn test_command() { + todo!() +} diff --git a/crates/shirabe/tests/downloader/main.rs b/crates/shirabe/tests/downloader/main.rs new file mode 100644 index 0000000..97f2ee4 --- /dev/null +++ b/crates/shirabe/tests/downloader/main.rs @@ -0,0 +1 @@ +mod xz_downloader_test; diff --git a/crates/shirabe/tests/downloader/xz_downloader_test.rs b/crates/shirabe/tests/downloader/xz_downloader_test.rs index 33a34ae..9650991 100644 --- a/crates/shirabe/tests/downloader/xz_downloader_test.rs +++ b/crates/shirabe/tests/downloader/xz_downloader_test.rs @@ -1 +1,7 @@ //! ref: composer/tests/Composer/Test/Downloader/XzDownloaderTest.php + +#[test] +#[ignore = "needs a real HttpDownloader/Loop and an XzDownloader download cycle; HttpDownloader construction reaches curl_multi_init (todo!()) in the php-shim"] +fn test_error_messages() { + todo!() +} diff --git a/crates/shirabe/tests/package/archiver/mod.rs b/crates/shirabe/tests/package/archiver/mod.rs index b77fb71..0dd410b 100644 --- a/crates/shirabe/tests/package/archiver/mod.rs +++ b/crates/shirabe/tests/package/archiver/mod.rs @@ -1 +1,2 @@ mod git_exclude_filter_test; +mod phar_archiver_test; diff --git a/crates/shirabe/tests/package/archiver/phar_archiver_test.rs b/crates/shirabe/tests/package/archiver/phar_archiver_test.rs index a1de919..414aa36 100644 --- a/crates/shirabe/tests/package/archiver/phar_archiver_test.rs +++ b/crates/shirabe/tests/package/archiver/phar_archiver_test.rs @@ -1 +1,13 @@ //! ref: composer/tests/Composer/Test/Package/Archiver/PharArchiverTest.php + +#[test] +#[ignore = "PharArchiver::archive builds a tar via PharData, which is todo!() in the php-shim"] +fn test_tar_archive() { + todo!() +} + +#[test] +#[ignore = "PharArchiver::archive builds a zip via ZipArchive, which is todo!() in the php-shim"] +fn test_zip_archive() { + todo!() +} diff --git a/crates/shirabe/tests/util/error_handler_test.rs b/crates/shirabe/tests/util/error_handler_test.rs index 3fecc60..92ce4e8 100644 --- a/crates/shirabe/tests/util/error_handler_test.rs +++ b/crates/shirabe/tests/util/error_handler_test.rs @@ -1 +1,24 @@ //! ref: composer/tests/Composer/Test/Util/ErrorHandlerTest.php + +// These tests rely on PHP's runtime error-handling machinery: ErrorHandler::register() +// installs a handler that converts notices/warnings into \ErrorException, and the tests +// trigger those by undefined-index access / array_merge misuse. There is no equivalent +// runtime mechanism in Rust to port faithfully. + +#[test] +#[ignore = "relies on PHP's set_error_handler converting an undefined-array-key notice into an ErrorException; no Rust equivalent"] +fn test_error_handler_capture_notice() { + todo!() +} + +#[test] +#[ignore = "relies on PHP's runtime turning an invalid array_merge call into a TypeError/ErrorException; no Rust equivalent"] +fn test_error_handler_capture_warning() { + todo!() +} + +#[test] +#[ignore = "relies on PHP's @ error-suppression operator and set_error_handler; no Rust equivalent"] +fn test_error_handler_respects_at_operator() { + todo!() +} diff --git a/crates/shirabe/tests/util/main.rs b/crates/shirabe/tests/util/main.rs index ce39655..1fb221b 100644 --- a/crates/shirabe/tests/util/main.rs +++ b/crates/shirabe/tests/util/main.rs @@ -1,4 +1,5 @@ mod config_validator_test; +mod error_handler_test; mod forgejo_url_test; mod http; mod metadata_minifier_test; |
