Skip to content

Commit 0edc8b9

Browse files
committed
Fix tests
1 parent 4a18348 commit 0edc8b9

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

tests/Dashboards/APCuTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@ public function testGetAllKeysTreeView(): void {
175175

176176
public function testExportAndImport(): void {
177177
$keys_to_test = [
178-
'e2e:apcu:key1' => ['value' => 'simple-value', 'ttl' => 120],
179-
'e2e:apcu:key2' => ['value' => 'no-expire-value', 'ttl' => 0],
180-
'e2e:apcu:key3' => ['value' => ['json' => 'data'], 'ttl' => 300],
178+
'pu:apcu:key1' => ['value' => 'simple-value', 'ttl' => 120],
179+
'pu:apcu:key2' => ['value' => 'no-expire-value', 'ttl' => 0],
180+
'pu:apcu:key3' => ['value' => ['json' => 'data'], 'ttl' => 300],
181181
];
182182

183183
$export_keys_array = [];
@@ -223,6 +223,7 @@ static function (string $key, string $value, int $ttl): bool {
223223
foreach ($keys_to_test as $key => $data) {
224224
$this->assertTrue(apcu_exists($key));
225225
$this->assertSame($data['value'], apcu_fetch($key));
226+
apcu_delete($key);
226227
}
227228

228229
unlink($tmp_file_path);

tests/Dashboards/MemcachedTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,9 @@ public function testGetAllKeysTreeView(): void {
246246
*/
247247
public function testExportAndImport(): void {
248248
$keys_to_test = [
249-
'e2e:mem:key1' => ['value' => 'simple-value', 'ttl' => 120],
250-
'e2e:mem:key2' => ['value' => 'no-expire-value', 'ttl' => 0],
251-
'e2e:mem:key3' => ['value' => '{"json": "data"}', 'ttl' => 300],
249+
'pu:mem:key1' => ['value' => 'simple-value', 'ttl' => 120],
250+
'pu:mem:key2' => ['value' => 'no-expire-value', 'ttl' => 0],
251+
'pu:mem:key3' => ['value' => '{"json": "data"}', 'ttl' => 300],
252252
];
253253

254254
$export_keys_array = [];
@@ -296,6 +296,7 @@ function (string $key): ?string {
296296
foreach ($keys_to_test as $key => $data) {
297297
$this->assertTrue($this->memcached->exists($key));
298298
$this->assertSame($data['value'], $this->memcached->getKey($key));
299+
$this->memcached->delete($key);
299300
}
300301

301302
unlink($tmp_file_path);

tests/Dashboards/Redis/RedisTestCase.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,8 @@ function (string $key, string $value, int $ttl): bool {
473473
$this->assertGreaterThan(0, $restored_ttl);
474474
$this->assertLessThanOrEqual($data['ttl'], $restored_ttl);
475475
}
476+
477+
$this->redis->del($key);
476478
}
477479

478480
unlink($tmp_file_path);

0 commit comments

Comments
 (0)