Skip to content

Commit

Permalink
fixing delete directory test and also purging destinations
Browse files Browse the repository at this point in the history
  • Loading branch information
jgivoni committed Jan 30, 2024
1 parent b857f91 commit cb6e535
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/CacheAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/DeleteDirectory_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cb6e535

Please sign in to comment.