Skip to content

Commit e5250de

Browse files
committed
Update tests
1 parent 841ec18 commit e5250de

3 files changed

Lines changed: 29 additions & 7 deletions

File tree

tests/Dashboards/APCuTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
namespace Tests\Dashboards;
1414

15+
use ReflectionException;
1516
use RobiNN\Pca\Dashboards\APCu\APCuDashboard;
1617
use RobiNN\Pca\Http;
1718
use RobiNN\Pca\Template;
@@ -27,6 +28,9 @@ protected function setUp(): void {
2728
$this->apcu = new APCuDashboard($this->template);
2829
}
2930

31+
/**
32+
* @throws ReflectionException
33+
*/
3034
public function testDeleteKey(): void {
3135
$key = 'pu-test-delete-key';
3236

@@ -41,6 +45,9 @@ public function testDeleteKey(): void {
4145
$this->assertFalse(apcu_exists($key));
4246
}
4347

48+
/**
49+
* @throws ReflectionException
50+
*/
4451
public function testDeleteKeys(): void {
4552
$key1 = 'pu-test-delete-key1';
4653
$key2 = 'pu-test-delete-key2';
@@ -61,6 +68,9 @@ public function testDeleteKeys(): void {
6168
$this->assertFalse(apcu_exists($key3));
6269
}
6370

71+
/**
72+
* @throws ReflectionException
73+
*/
6474
public function testGetKey(): void {
6575
$keys = [
6676
'string' => ['original' => 'phpCacheAdmin', 'expected' => 'phpCacheAdmin'],
@@ -95,6 +105,9 @@ public function testGetKey(): void {
95105
}
96106
}
97107

108+
/**
109+
* @throws ReflectionException
110+
*/
98111
public function testSaveKey(): void {
99112
$key = 'pu-test-save';
100113

tests/Dashboards/MemcachedTest.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212

1313
namespace Tests\Dashboards;
1414

15+
use ReflectionException;
1516
use RobiNN\Pca\Dashboards\Memcached\Compatibility\Memcache;
1617
use RobiNN\Pca\Dashboards\Memcached\Compatibility\Memcached;
18+
use RobiNN\Pca\Dashboards\Memcached\Compatibility\PHPMem;
1719
use RobiNN\Pca\Dashboards\Memcached\MemcachedDashboard;
1820
use RobiNN\Pca\Dashboards\Memcached\MemcachedException;
1921
use RobiNN\Pca\Http;
@@ -26,18 +28,21 @@ final class MemcachedTest extends TestCase {
2628
private MemcachedDashboard $dashboard;
2729

2830
/**
29-
* @var Memcache|Memcached
31+
* @var Memcached|Memcache|PHPMem
3032
*/
3133
private $memcached;
3234

35+
/**
36+
* @throws ReflectionException
37+
*/
3338
protected function setUp(): void {
3439
$this->template = new Template();
3540
$this->dashboard = new MemcachedDashboard($this->template);
3641
$this->memcached = self::callMethod($this->dashboard, 'connect', ['host' => '127.0.0.1']);
3742
}
3843

3944
/**
40-
* @throws MemcachedException
45+
* @throws MemcachedException|ReflectionException
4146
*/
4247
public function testDeleteKey(): void {
4348
$key = 'pu-test-delete-key';
@@ -54,7 +59,7 @@ public function testDeleteKey(): void {
5459
}
5560

5661
/**
57-
* @throws MemcachedException
62+
* @throws MemcachedException|ReflectionException
5863
*/
5964
public function testDeleteKeys(): void {
6065
$key1 = 'pu-test-delete-key1';
@@ -114,7 +119,7 @@ public function testGetKey(): void {
114119
}
115120

116121
/**
117-
* @throws MemcachedException
122+
* @throws MemcachedException|ReflectionException
118123
*/
119124
public function testSaveKey(): void {
120125
$key = 'pu-test-save';

tests/Dashboards/RedisTest.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
use Redis;
1616
use RedisException;
17+
use ReflectionException;
1718
use RobiNN\Pca\Dashboards\Redis\RedisDashboard;
1819
use RobiNN\Pca\Http;
1920
use RobiNN\Pca\Template;
@@ -26,14 +27,17 @@ final class RedisTest extends TestCase {
2627

2728
private Redis $redis;
2829

30+
/**
31+
* @throws ReflectionException
32+
*/
2933
protected function setUp(): void {
3034
$this->template = new Template();
3135
$this->dashboard = new RedisDashboard($this->template);
3236
$this->redis = self::callMethod($this->dashboard, 'connect', ['host' => '127.0.0.1', 'database' => 10]);
3337
}
3438

3539
/**
36-
* @throws RedisException
40+
* @throws RedisException|ReflectionException
3741
*/
3842
public function testDeleteKey(): void {
3943
$key = 'pu-test-delete-key';
@@ -50,7 +54,7 @@ public function testDeleteKey(): void {
5054
}
5155

5256
/**
53-
* @throws RedisException
57+
* @throws RedisException|ReflectionException
5458
*/
5559
public function testDeleteKeys(): void {
5660
$key1 = 'pu-test-delete-key1';
@@ -110,7 +114,7 @@ public function testGetKey(): void {
110114
}
111115

112116
/**
113-
* @throws RedisException
117+
* @throws RedisException|ReflectionException
114118
*/
115119
public function testSaveKey(): void {
116120
$key = 'pu-test-save';

0 commit comments

Comments
 (0)