Skip to content

Commit 70b8cab

Browse files
committed
Implement cache integration tests
1 parent 0d2a31d commit 70b8cab

4 files changed

Lines changed: 35 additions & 1 deletion

File tree

composer.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,16 @@
1212
"ext-mbstring": "*",
1313
"kint-php/kint": "^3.3",
1414
"laminas/laminas-escaper": "^2.6",
15-
"psr/log": "^1.1"
15+
"psr/cache": "^1.0",
16+
"psr/log": "^1.1",
17+
"psr/simple-cache": "^1.0"
18+
},
19+
"provide": {
20+
"psr/cache-implementation": "^1.0",
21+
"psr/simple-cache-implementation": "^1.0"
1622
},
1723
"require-dev": {
24+
"cache/integration-tests": "^0.17.0",
1825
"codeigniter4/codeigniter4-standard": "^1.0",
1926
"fakerphp/faker": "^1.9",
2027
"mikey179/vfsstream": "^1.6",

phpunit.xml.dist

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
<testsuite name="Database">
4444
<directory>./tests/system/Database</directory>
4545
</testsuite>
46+
<testsuite name="Psr">
47+
<directory>./tests/psr</directory>
48+
</testsuite>
4649
</testsuites>
4750

4851
<extensions>

tests/psr/CachePoolTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
use Cache\IntegrationTests\CachePoolTest as TestCase;
4+
use CodeIgniter\Psr\Cache\Pool;
5+
6+
class CachePoolTest extends TestCase
7+
{
8+
public function createCachePool()
9+
{
10+
return new Pool();
11+
}
12+
}

tests/psr/SimpleCacheTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
use Cache\IntegrationTests\SimpleCacheTest as TestCase;
4+
use CodeIgniter\Psr\Cache\SimpleCache;
5+
6+
class SimpleCacheTest extends TestCase
7+
{
8+
public function createSimpleCache()
9+
{
10+
return new SimpleCache();
11+
}
12+
}

0 commit comments

Comments
 (0)