Skip to content

Commit 20159bc

Browse files
committed
chore(deps-dev): update boundwize/structarmed requirement (#10408)
1 parent 8c164d0 commit 20159bc

7 files changed

Lines changed: 41 additions & 80 deletions

File tree

‎.github/scripts/random-tests-config.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
API
1212
AutoReview
1313
Autoloader
14-
# Cache
14+
Cache
1515
CLI
1616
Commands
1717
Config

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"psr/log": "^3.0"
1818
},
1919
"require-dev": {
20-
"boundwize/structarmed": "0.14.15",
20+
"boundwize/structarmed": "0.14.16",
2121
"codeigniter/phpstan-codeigniter": "^2.1",
2222
"fakerphp/faker": "^1.24",
2323
"kint-php/kint": "^6.1",

‎tests/system/Cache/Handlers/ApcuHandlerTest.php‎

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,30 +27,28 @@
2727
#[RequiresPhpExtension('apcu')]
2828
final class ApcuHandlerTest extends AbstractHandlerTestCase
2929
{
30-
/**
31-
* @return list<string>
32-
*/
33-
private static function getKeyArray(): array
34-
{
35-
return [
36-
self::$key1,
37-
self::$key2,
38-
self::$key3,
39-
];
40-
}
41-
4230
protected function setUp(): void
4331
{
4432
parent::setUp();
4533

34+
if (! function_exists('apcu_enabled') || ! apcu_enabled()) {
35+
$this->markTestSkipped('APCu extension is not loaded or not enabled in CLI.');
36+
}
37+
4638
$this->handler = CacheFactory::getHandler(new Cache(), 'apcu');
4739
}
4840

4941
protected function tearDown(): void
5042
{
51-
foreach (self::getKeyArray() as $key) {
52-
$this->handler->delete($key);
43+
if (! isset($this->handler)) {
44+
parent::tearDown();
45+
46+
return;
5347
}
48+
49+
$this->handler->clean();
50+
51+
parent::tearDown();
5452
}
5553

5654
public function testNew(): void

‎tests/system/Cache/Handlers/FileHandlerTest.php‎

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,6 @@ final class FileHandlerTest extends AbstractHandlerTestCase
3131
private static string $directory = 'FileHandler';
3232
private Cache $config;
3333

34-
/**
35-
* @return list<string>
36-
*/
37-
private static function getKeyArray(): array
38-
{
39-
return [
40-
self::$key1,
41-
self::$key2,
42-
self::$key3,
43-
];
44-
}
45-
4634
protected function setUp(): void
4735
{
4836
parent::setUp();
@@ -69,15 +57,8 @@ protected function tearDown(): void
6957
if (is_dir($this->config->file['storePath'])) {
7058
chmod($this->config->file['storePath'], 0777);
7159

72-
foreach (self::getKeyArray() as $key) {
73-
if (is_file($this->config->file['storePath'] . DIRECTORY_SEPARATOR . $key)) {
74-
chmod($this->config->file['storePath'] . DIRECTORY_SEPARATOR . $key, 0777);
75-
unlink($this->config->file['storePath'] . DIRECTORY_SEPARATOR . $key);
76-
}
77-
if (is_file($this->config->file['storePath'] . DIRECTORY_SEPARATOR . $this->config->prefix . $key)) {
78-
chmod($this->config->file['storePath'] . DIRECTORY_SEPARATOR . $this->config->prefix . $key, 0777);
79-
unlink($this->config->file['storePath'] . DIRECTORY_SEPARATOR . $this->config->prefix . $key);
80-
}
60+
if (isset($this->handler)) {
61+
$this->handler->clean();
8162
}
8263

8364
rmdir($this->config->file['storePath']);
@@ -118,7 +99,7 @@ public function testSetDefaultPath(): void
11899
*/
119100
public function testGet(): void
120101
{
121-
$this->handler->save(self::$key1, 'value', 2);
102+
$this->assertTrue($this->handler->save(self::$key1, 'value', 2));
122103

123104
$this->assertSame('value', $this->handler->get(self::$key1));
124105
$this->assertNull($this->handler->get(self::$dummy));

‎tests/system/Cache/Handlers/MemcachedHandlerTest.php‎

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,6 @@
2626
#[Group('CacheLive')]
2727
final class MemcachedHandlerTest extends AbstractHandlerTestCase
2828
{
29-
/**
30-
* @return list<string>
31-
*/
32-
private static function getKeyArray(): array
33-
{
34-
return [
35-
self::$key1,
36-
self::$key2,
37-
self::$key3,
38-
];
39-
}
40-
4129
protected function setUp(): void
4230
{
4331
parent::setUp();
@@ -51,9 +39,15 @@ protected function setUp(): void
5139

5240
protected function tearDown(): void
5341
{
54-
foreach (self::getKeyArray() as $key) {
55-
$this->handler->delete($key);
42+
if (! isset($this->handler)) {
43+
parent::tearDown();
44+
45+
return;
5646
}
47+
48+
$this->handler->clean();
49+
50+
parent::tearDown();
5751
}
5852

5953
public function testNew(): void

‎tests/system/Cache/Handlers/PredisHandlerTest.php‎

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,6 @@ final class PredisHandlerTest extends AbstractHandlerTestCase
2727
{
2828
private Cache $config;
2929

30-
/**
31-
* @return list<string>
32-
*/
33-
private static function getKeyArray(): array
34-
{
35-
return [
36-
self::$key1,
37-
self::$key2,
38-
self::$key3,
39-
];
40-
}
41-
4230
protected function setUp(): void
4331
{
4432
parent::setUp();
@@ -49,9 +37,15 @@ protected function setUp(): void
4937

5038
protected function tearDown(): void
5139
{
52-
foreach (self::getKeyArray() as $key) {
53-
$this->handler->delete($key);
40+
if (! isset($this->handler)) {
41+
parent::tearDown();
42+
43+
return;
5444
}
45+
46+
$this->handler->clean();
47+
48+
parent::tearDown();
5549
}
5650

5751
public function testNew(): void

‎tests/system/Cache/Handlers/RedisHandlerTest.php‎

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,6 @@ final class RedisHandlerTest extends AbstractHandlerTestCase
2828
{
2929
private Cache $config;
3030

31-
/**
32-
* @return list<string>
33-
*/
34-
private static function getKeyArray(): array
35-
{
36-
return [
37-
self::$key1,
38-
self::$key2,
39-
self::$key3,
40-
];
41-
}
42-
4331
protected function setUp(): void
4432
{
4533
parent::setUp();
@@ -54,9 +42,15 @@ protected function setUp(): void
5442

5543
protected function tearDown(): void
5644
{
57-
foreach (self::getKeyArray() as $key) {
58-
$this->handler->delete($key);
45+
if (! isset($this->handler)) {
46+
parent::tearDown();
47+
48+
return;
5949
}
50+
51+
$this->handler->clean();
52+
53+
parent::tearDown();
6054
}
6155

6256
public function testNew(): void

0 commit comments

Comments
 (0)