Skip to content

Commit e86b75a

Browse files
committed
Fix rector transform
1 parent 3b7046a commit e86b75a

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

tests/system/Cache/Handlers/RedisHandlerTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ public function testDeleteMatching(string $pattern, int $expectedDeleteCount, st
151151
$this->assertIsArray($cacheInfo);
152152
$this->assertArrayHasKey('db0', $cacheInfo);
153153
$this->assertIsString($cacheInfo['db0']);
154-
$this->assertSame(1, preg_match('/^keys=(?P<count>\d+)/', $cacheInfo['db0'], $matches));
154+
$this->assertMatchesRegularExpression('/^keys=(?P<count>\d+)/', $cacheInfo['db0']);
155+
156+
preg_match('/^keys=(?P<count>\d+)/', $cacheInfo['db0'], $matches);
155157
$this->assertSame(101, (int) $matches['count']);
156158

157159
$this->assertSame($expectedDeleteCount, $handler->deleteMatching($pattern));
@@ -160,7 +162,9 @@ public function testDeleteMatching(string $pattern, int $expectedDeleteCount, st
160162
$this->assertIsArray($cacheInfo);
161163
$this->assertArrayHasKey('db0', $cacheInfo);
162164
$this->assertIsString($cacheInfo['db0']);
163-
$this->assertSame(1, preg_match('/^keys=(?P<count>\d+)/', $cacheInfo['db0'], $matches));
165+
$this->assertMatchesRegularExpression('/^keys=(?P<count>\d+)/', $cacheInfo['db0']);
166+
167+
preg_match('/^keys=(?P<count>\d+)/', $cacheInfo['db0'], $matches);
164168
$this->assertSame(101 - $expectedDeleteCount, (int) $matches['count']);
165169

166170
$handler->deleteMatching('key_*');

0 commit comments

Comments
 (0)