Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 4983dff

Browse files
committed
Merge branch 'hotfix/168'
Close #168
2 parents a7af5ce + 68119c5 commit 4983dff

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

CHANGELOG.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
All notable changes to this project will be documented in this file, in reverse chronological order by release.
44

5-
## 2.8.2 - TBD
5+
## 2.8.2 - 2018-05-01
66

77
### Added
88

@@ -22,7 +22,8 @@ All notable changes to this project will be documented in this file, in reverse
2222

2323
### Fixed
2424

25-
- Nothing.
25+
- [#168](https://github.com/zendframework/zend-cache/pull/168) fixes a typo in a variable name within the `Filesystem::setTags()` method which
26+
prevented clearing of tags when using that adapter.
2627

2728
## 2.8.1 - 2018-04-26
2829

src/Storage/Adapter/Filesystem.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ public function setTags($key, array $tags)
327327
$filespec = $this->getFileSpec($key);
328328

329329
if (! $tags) {
330-
$this->unlink($this->formatTagFilename($filespac));
330+
$this->unlink($this->formatTagFilename($filespec));
331331
return true;
332332
}
333333

test/Storage/Adapter/FilesystemTest.php

+11
Original file line numberDiff line numberDiff line change
@@ -608,4 +608,15 @@ public function testTagSuffixIsMutable()
608608
$this->_options->setTagSuffix('.cache');
609609
$this->assertSame('.cache', $this->_options->getTagSuffix());
610610
}
611+
612+
public function testEmptyTagsArrayClearsTags()
613+
{
614+
$key = 'key';
615+
$tags = ['tag1', 'tag2', 'tag3'];
616+
$this->assertTrue($this->_storage->setItem($key, 100));
617+
$this->assertTrue($this->_storage->setTags($key, $tags));
618+
$this->assertNotEmpty($this->_storage->getTags($key));
619+
$this->assertTrue($this->_storage->setTags($key, []));
620+
$this->assertEmpty($this->_storage->getTags($key));
621+
}
611622
}

0 commit comments

Comments
 (0)