aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/tests/util/error_handler_test.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-07-12 01:28:17 +0900
committernsfisis <nsfisis@gmail.com>2026-07-16 01:02:47 +0900
commit4d9e3dd6176a0cd2cc5e158b044beeb7b3de21be (patch)
treeed19d9660f40a1bc93c5629c7a6c7bf41cf884e8 /crates/shirabe/tests/util/error_handler_test.rs
parent4e1170c2328dd8007a5d737a759cd18030b1200b (diff)
downloadphp-shirabe-4d9e3dd6176a0cd2cc5e158b044beeb7b3de21be.tar.gz
php-shirabe-4d9e3dd6176a0cd2cc5e158b044beeb7b3de21be.tar.zst
php-shirabe-4d9e3dd6176a0cd2cc5e158b044beeb7b3de21be.zip
test(util): port remaining todo!() tests in util test suite
Implement previously-todo!() tests in auth_helper_test.rs, process_executor_test.rs, remote_filesystem_test.rs, and stream_context_factory_test.rs by porting the corresponding PHPUnit test methods. Extend IOStub with writeRaw/setAuthentication call tracking and askAndValidate/getAuthentication overrides to model the PHPUnit mocks these tests rely on, deduping the resulting call-recording fields into a small generic CallRecorder<T> helper instead of repeating the same RefCell<Vec<T>> push/borrow().clone() boilerplate five times. testStoreAuthWithPromptInvalidAnswer and testPromptAuthIfNeededMultipleBitbucketDownloads had initially lost the ported PHPUnit mock's argument/call-count assertions (askAndValidate's exact prompt string, and hasAuthentication/getAuthentication's exactly(2) call counts), silently narrowing what the tests verify; IOStub now records these calls and the tests assert on them, matching upstream. Tests left unportable (PHP set_error_handler machinery, closures in data providers, network/subclass-mock dependencies, etc.) keep #[ignore] with a single // TODO(phase-d) reason recorded in the function body. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/tests/util/error_handler_test.rs')
-rw-r--r--crates/shirabe/tests/util/error_handler_test.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/crates/shirabe/tests/util/error_handler_test.rs b/crates/shirabe/tests/util/error_handler_test.rs
index 7295cf2a..ed5e6a29 100644
--- a/crates/shirabe/tests/util/error_handler_test.rs
+++ b/crates/shirabe/tests/util/error_handler_test.rs
@@ -5,15 +5,15 @@
// trigger those by undefined-index access / array_merge misuse. There is no equivalent
// runtime mechanism in Rust to port faithfully.
+// TODO(phase-d): ErrorHandler::register() installs a PHP set_error_handler; no Rust equivalent.
#[allow(dead_code)]
fn set_up() {
- // ErrorHandler::register() installs a PHP set_error_handler; no Rust equivalent.
todo!()
}
+// TODO(phase-d): restore_error_handler() is PHP runtime machinery; no Rust equivalent.
#[allow(dead_code)]
fn tear_down() {
- // restore_error_handler() is PHP runtime machinery; no Rust equivalent.
todo!()
}
@@ -29,17 +29,24 @@ impl Drop for TearDown {
#[ignore = "depends on PHP runtime routing an undefined-index notice through set_error_handler; no Rust equivalent for $array['baz'] triggering ErrorHandler::handle"]
#[test]
fn test_error_handler_capture_notice() {
+ // TODO(phase-d): depends on PHP runtime routing an undefined-index notice through
+ // set_error_handler; no Rust equivalent for $array['baz'] triggering
+ // ErrorHandler::handle.
todo!()
}
#[ignore = "depends on PHP runtime emitting a TypeError/warning from array_merge([], 'string') via set_error_handler; no Rust equivalent"]
#[test]
fn test_error_handler_capture_warning() {
+ // TODO(phase-d): depends on PHP runtime emitting a TypeError/warning from
+ // array_merge([], 'string') via set_error_handler; no Rust equivalent.
todo!()
}
#[ignore = "depends on the PHP @ error-suppression operator and trigger_error routing through set_error_handler; no Rust equivalent"]
#[test]
fn test_error_handler_respects_at_operator() {
+ // TODO(phase-d): depends on the PHP @ error-suppression operator and trigger_error
+ // routing through set_error_handler; no Rust equivalent.
todo!()
}