diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-24 00:47:20 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-24 00:47:53 +0900 |
| commit | 340164c64e90d44b1bdf620b514166db1f76cc98 (patch) | |
| tree | 86195fe5ff8582b64e0324e9f40619e36c04948f /crates/shirabe/tests/config_test.rs | |
| parent | 8fe3390d064303b86133a1d2983144a4818a7121 (diff) | |
| download | php-shirabe-340164c64e90d44b1bdf620b514166db1f76cc98.tar.gz php-shirabe-340164c64e90d44b1bdf620b514166db1f76cc98.tar.zst php-shirabe-340164c64e90d44b1bdf620b514166db1f76cc98.zip | |
test: port more unimplemented tests
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/tests/config_test.rs')
| -rw-r--r-- | crates/shirabe/tests/config_test.rs | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/crates/shirabe/tests/config_test.rs b/crates/shirabe/tests/config_test.rs index fb40cac..75e1a24 100644 --- a/crates/shirabe/tests/config_test.rs +++ b/crates/shirabe/tests/config_test.rs @@ -486,10 +486,37 @@ fn test_prohibited_urls_throw_exception() { } } -#[ignore = "requires getIOMock with expects() output expectations; no IO mocking infrastructure exists"] +// PHP asserts the warning via getIOMock()->expects(); here a real BufferIO captures the output +// instead. The case stays #[ignore] because BufferIO::get_output is todo!() (its PhpResource +// stream model is unfinished). +#[ignore = "BufferIO::get_output is todo!() (PhpResource stream model unfinished)"] #[test] fn test_prohibited_urls_warning_verify_peer() { - todo!() + let io = std::rc::Rc::new(std::cell::RefCell::new( + shirabe::io::buffer_io::BufferIO::new( + String::new(), + shirabe_external_packages::symfony::console::output::output_interface::VERBOSITY_NORMAL, + None, + ) + .unwrap(), + )); + + let mut config = Config::new(false, None); + + let mut ssl: IndexMap<String, PhpMixed> = IndexMap::new(); + ssl.insert("verify_peer".to_string(), PhpMixed::Bool(false)); + ssl.insert("verify_peer_name".to_string(), PhpMixed::Bool(false)); + let mut repo_options: IndexMap<String, PhpMixed> = IndexMap::new(); + repo_options.insert("ssl".to_string(), PhpMixed::Array(ssl)); + + config + .prohibit_url_by_config("https://example.org", Some(io.clone()), &repo_options) + .unwrap(); + + assert_eq!( + "<warning>Warning: Accessing example.org with verify_peer and verify_peer_name disabled.</warning>", + io.borrow().get_output() + ); } #[ignore] |
