Skip to content

Commit 8f7a215

Browse files
committed
- removed suppressed tests
1 parent fc08b41 commit 8f7a215

10 files changed

Lines changed: 53 additions & 53 deletions

Tests/Integration/FileClientTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ public function createSimpleCache()
2727

2828
protected function setUp(): void
2929
{
30-
$this->skippedTests = [
31-
'testSetMultipleInvalidKeys' => '',
32-
];
33-
3430
$this->dir = vfsStream::setup();
3531
parent::setUp();
3632
}

Tests/Integration/MemcachedClientTest.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,6 @@ protected function setUp(): void
3535

3636
$this->skippedTests = [
3737
'testBasicUsageWithLongKey' => 'Memcached max key length is 250 chars',
38-
39-
'testSet' => '',
40-
'testSetTtl' => '',
41-
'testSetExpiredTtl' => '',
42-
'testGet' => '',
43-
'testDelete' => '',
44-
'testClear' => '',
45-
46-
'testSetMultiple' => '',
47-
'testSetMultipleWithIntegerArrayKey' => '',
48-
'testSetMultipleTtl' => '',
49-
'testSetMultipleExpiredTtl' => '',
50-
'testSetMultipleWithGenerator' => '',
51-
'testGetMultiple' => '',
52-
'testSetMultipleInvalidKeys' => '',
5338
];
5439
}
5540
}

Tests/Integration/MemoryClientTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ class MemoryClientTest extends SimpleCacheTest
1515
*/
1616
public function createSimpleCache()
1717
{
18-
$this->skippedTests = [
19-
'testSetMultipleInvalidKeys' => '',
20-
];
21-
2218
return simple_cache_factory('memory');
2319
}
2420
}

Tests/Integration/PredisClientTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ class PredisClientTest extends SimpleCacheTest
1515
*/
1616
public function createSimpleCache()
1717
{
18-
$this->skippedTests = [
19-
'testSetMultipleInvalidKeys' => '',
20-
];
21-
2218
return simple_cache_factory('predis', [
2319
'host' => getenv('REDIS_SERVER_HOST'),
2420
]);

Tests/Integration/PredisJsonClientTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ class PredisJsonClientTest extends SimpleCacheTest
1616
*/
1717
public function createSimpleCache()
1818
{
19-
$this->skippedTests = [
20-
'testSetMultipleInvalidKeys' => '',
21-
];
22-
2319
return simple_cache_factory('predis', [
2420
'host' => getenv('REDIS_SERVER_HOST'),
2521
'port' => getenv('REDIS_SERVER_PORT'),

Tests/Integration/RedisClientTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ class RedisClientTest extends SimpleCacheTest
1515
*/
1616
public function createSimpleCache()
1717
{
18-
$this->skippedTests = [
19-
'testSetMultipleInvalidKeys' => '',
20-
];
21-
2218
return simple_cache_factory('redis', [
2319
'host' => getenv('REDIS_SERVER_HOST'),
2420
]);

Tests/Integration/RedisJsonClientTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ class RedisJsonClientTest extends SimpleCacheTest
1616
*/
1717
public function createSimpleCache()
1818
{
19-
$this->skippedTests = [
20-
'testSetMultipleInvalidKeys' => '',
21-
];
22-
2319
return simple_cache_factory('redis', [
2420
'host' => getenv('REDIS_SERVER_HOST'),
2521
'serializer' => Serializer::JSON,
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace Koded\Caching;
4+
5+
use Cache\IntegrationTests\SimpleCacheTest;
6+
use Koded\Caching\Tests\Integration\SimpleCacheIntegrationTrait;
7+
8+
class ShmopClientTest extends SimpleCacheTest
9+
{
10+
use SimpleCacheIntegrationTrait;
11+
12+
public function createSimpleCache()
13+
{
14+
return simple_cache_factory('shmop');
15+
}
16+
17+
protected function setup()
18+
{
19+
if (false === extension_loaded('shmop')) {
20+
$this->markTestSkipped('shmop extension is not loaded.');
21+
}
22+
23+
parent::setUp();
24+
$this->cache->clear();
25+
}
26+
}

Tests/Integration/SimpleCacheIntegrationTrait.php

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,42 @@
44

55
trait SimpleCacheIntegrationTrait
66
{
7+
protected function tearDown(): void
8+
{
9+
putenv('CACHE_CLIENT=');
10+
11+
if ($this->cache !== null) {
12+
$this->cache->clear();
13+
}
14+
15+
$this->cache = null;
16+
}
17+
18+
/** overwritten */
19+
public static function invalidKeys()
20+
{
21+
return self::removeColumnFromInvalidKeys();
22+
}
23+
24+
/** overwritten */
25+
public static function invalidArrayKeys()
26+
{
27+
return self::removeColumnFromInvalidKeys();
28+
}
29+
730
/**
831
* Data provider for invalid keys.
932
* Allows ":" in the cache key name.
1033
*
1134
* @return array
1235
*/
13-
public static function invalidKeys()
36+
private static function removeColumnFromInvalidKeys(): array
1437
{
1538
$keys = parent::invalidKeys();
39+
unset($keys[14]);
1640

17-
unset($keys[14]); // allow ":" in the key name
18-
19-
return array_values($keys);
41+
return $keys;
2042
}
2143

22-
protected function tearDown(): void
23-
{
24-
putenv('CACHE_CLIENT=');
25-
26-
if ($this->cache !== null) {
27-
$this->cache->clear();
28-
}
2944

30-
$this->cache = null;
31-
}
3245
}

Tests/RedisWithOnlyJsonSerializerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function test_should_store_and_retrieve_the_same_cache_item($data)
6868

6969
protected function setUp(): void
7070
{
71-
$this->markTestSkipped('Redis JSON serializer skipped for now...');
71+
// $this->markTestSkipped('Redis JSON serializer skipped for now...');
7272

7373
if (false === extension_loaded('redis')) {
7474
$this->markTestSkipped('Redis extension is not loaded.');

0 commit comments

Comments
 (0)