diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-07 07:01:50 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-07 07:01:50 +0900 |
| commit | 759b2980e70dfb8960238f75d68bb6dddce25414 (patch) | |
| tree | e37a0af6423f8ae8dd26da309b278d49d45b3451 /crates/shirabe/tests/downloader/file_downloader_test.rs | |
| parent | 9a393adc0ace86cac788723b524e83c63dfc91c1 (diff) | |
| download | php-shirabe-759b2980e70dfb8960238f75d68bb6dddce25414.tar.gz php-shirabe-759b2980e70dfb8960238f75d68bb6dddce25414.tar.zst php-shirabe-759b2980e70dfb8960238f75d68bb6dddce25414.zip | |
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) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/tests/downloader/file_downloader_test.rs')
| -rw-r--r-- | crates/shirabe/tests/downloader/file_downloader_test.rs | 20 |
1 files changed, 12 insertions, 8 deletions
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!() } |
