diff --git a/src/CacheAdapter.php b/src/CacheAdapter.php index d41717a..e7af0a7 100644 --- a/src/CacheAdapter.php +++ b/src/CacheAdapter.php @@ -415,6 +415,7 @@ public function move(string $source, string $destination, Config $config): void $this->adapter->move($source, $destination, $config); } catch (UnableToMoveFile $e) { $this->purgeCacheItem($source); + $this->purgeCacheItem($destination); throw $e; } @@ -446,6 +447,7 @@ public function copy(string $source, string $destination, Config $config): void $this->adapter->copy($source, $destination, $config); } catch (UnableToCopyFile $e) { $this->purgeCacheItem($source); + $this->purgeCacheItem($destination); throw $e; } diff --git a/tests/DeleteDirectory_Test.php b/tests/DeleteDirectory_Test.php index ae34a41..a3e4104 100644 --- a/tests/DeleteDirectory_Test.php +++ b/tests/DeleteDirectory_Test.php @@ -46,7 +46,7 @@ public function nested_files_are_purged_from_cache(): void */ public function cache_is_purged_after_unsuccessful_delete(): void { - $path = 'deleted-cached-folder'; + $path = 'deleted-cached-directory'; try { $this->cacheAdapter->deleteDirectory($path);