Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/lib/Memcache/MemcachedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ public static function setUpBeforeClass(): void {
protected function setUp(): void {
parent::setUp();
$this->instance = new Memcached($this->getUniqueID());
// Flush the shared \Memcached singleton so that its internal result
// code is reset to RES_SUCCESS before the first get() of each test.
// Without this, a prior test that ended with a successful set/get
// leaves RES_SUCCESS in the singleton, and if the underlying library
// then returns false+RES_SUCCESS for a missing key the get() wrapper
// cannot tell the difference from a stored false value.
$this->instance->clear();
}

#[\Override]
Expand Down
Loading