From 759b2980e70dfb8960238f75d68bb6dddce25414 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 7 Aug 2026 07:01:50 +0900 Subject: test: port the tests left as todo!() stubs Replace the todo!() bodies with real ports. Four autoload-generator tests now run for real; the rest stay #[ignore]d, but each ignore reason now names the concrete missing symbol instead of a vague subsystem. Production additions the ports need: the deprecated AuthHelper::addAuthenticationHeader wrapper, EventDispatcher::__set_dispatch_script_override as the seam for PHPUnit onlyMethods(['dispatchScript']), and a define() stub in the shim. Co-Authored-By: Claude Opus 5 (1M context) --- .../shirabe/tests/downloader/file_downloader_test.rs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'crates/shirabe/tests/downloader') diff --git a/crates/shirabe/tests/downloader/file_downloader_test.rs b/crates/shirabe/tests/downloader/file_downloader_test.rs index 65dc1a51..469bf473 100644 --- a/crates/shirabe/tests/downloader/file_downloader_test.rs +++ b/crates/shirabe/tests/downloader/file_downloader_test.rs @@ -177,20 +177,24 @@ fn test_download_but_file_is_unsaved() { } #[test] -#[ignore = "requires PHPUnit mocks of Cache::copyTo/copyFrom asserting on $cacheKey plus PreFileDownloadEvent::setProcessedUrl dispatch, which is TODO(plugin) in FileDownloader::download"] +#[ignore = "the listener is a closure that mutates the event (setProcessedUrl), but Callable::Closure receives `&dyn EventInterface`, so it cannot; and CacheMock has no copy_to/copy_from hooks to assert the cache key on"] fn test_download_with_custom_processed_url() { - // TODO(phase-d): requires PHPUnit mocks of Cache::copyTo/copyFrom asserting on $cacheKey - // plus PreFileDownloadEvent::setProcessedUrl dispatch, which is TODO(plugin) in - // FileDownloader::download. + // TODO(phase-d): the PRE_FILE_DOWNLOAD listener is a closure calling + // PreFileDownloadEvent::setProcessedUrl, but Callable::Closure is + // `Fn(&dyn EventInterface)`, so a listener cannot mutate the event it receives. The Cache + // half is likewise inexpressible: CacheMock carries only finder/gc overrides, with no + // copy_to/copy_from hook to assert the cache key on. todo!() } #[test] -#[ignore = "requires PHPUnit mocks of Cache::copyTo/copyFrom asserting on $cacheKey plus PreFileDownloadEvent::setCustomCacheKey dispatch, which is TODO(plugin) in FileDownloader::download"] +#[ignore = "the listener is a closure that mutates the event (setCustomCacheKey), but Callable::Closure receives `&dyn EventInterface`, so it cannot; and CacheMock has no copy_to/copy_from hooks to assert the cache key on"] fn test_download_with_custom_cache_key() { - // TODO(phase-d): requires PHPUnit mocks of Cache::copyTo/copyFrom asserting on $cacheKey - // plus PreFileDownloadEvent::setCustomCacheKey dispatch, which is TODO(plugin) in - // FileDownloader::download. + // TODO(phase-d): the PRE_FILE_DOWNLOAD listener is a closure calling + // PreFileDownloadEvent::setCustomCacheKey, but Callable::Closure is + // `Fn(&dyn EventInterface)`, so a listener cannot mutate the event it receives. The Cache + // half is likewise inexpressible: CacheMock carries only finder/gc overrides, with no + // copy_to/copy_from hook to assert the cache key on. todo!() } -- cgit v1.3.1