8000 Merge branch '6.4' into 7.1 · symfony/cache@94512ba · GitHub
[go: up one dir, main page]

Skip to content

Commit 94512ba

Browse files
Merge branch '6.4' into 7.1
* 6.4: initialize RedisAdapter cursor to 0 do not skip tests from data providers ensure compatibility with Twig 3.15 [Mime] fix encoding issue with UTF-8 addresses containing doubles spaces fix translation file syntax [Notifier] Improve Telegrams markdown escaping [Validator] [Choice] Fix callback option if not array returned [DependencyInjection] Fix linting factories implemented via __callStatic [DependencyInjection] Fix replacing abstract arguments with bindings Minor fixes around parse_url() checks Ensure compatibility with mongodb v2 Add missing translations for Turkish (tr)
2 parents 2002110 + 0188352 commit 94512ba

File tree

2 files changed

+17
-21
lines changed

2 files changed

+17
-21
lines changed

Tests/Adapter/MemcachedAdapterTest.php

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -169,33 +169,29 @@ public static function provideServersSetting(): iterable
169169
}
170170

171171
/**
172-
* @dataProvider provideDsnWithOptions
172+
* @requires extension memcached
173173
*/
174-
public function testDsnWithOptions(string $dsn, array $options, array $expectedOptions)
174+
public function testOptionsFromDsnWinOverAdditionallyPassedOptions()
175175
{
176-
$client = MemcachedAdapter::createConnection($dsn, $options);
176+
$client = MemcachedAdapter::createConnection('memcached://localhost:11222?retry_timeout=10', [
177+
\Memcached::OPT_RETRY_TIMEOUT => 8,
178+
]);
177179

178-
foreach ($expectedOptions as $option => $expect) {
179-
$this->assertSame($expect, $client->getOption($option));
180-
}
180+
$this->assertSame(10, $client->getOption(\Memcached::OPT_RETRY_TIMEOUT));
181181
}
182182

183-
public static function provideDsnWithOptions(): iterable
183+
/**
184+
* @requires extension memcached
185+
*/
186+
public function testOptionsFromDsnAndAdditionallyPassedOptionsAreMerged()
184187
{
185-
if (!class_exists(\Memcached::class)) {
186-
self::markTestSkipped('Extension memcached required.');
187-
}
188+
$client = MemcachedAdapter::createConnection('memcached://localhost:11222?socket_recv_size=1&socket_send_size=2', [
189+
\Memcached::OPT_RETRY_TIMEOUT => 8,
190+
]);
188191

189-
yield [
190-
'memcached://localhost:11222?retry_timeout=10',
191-
[\Memcached::OPT_RETRY_TIMEOUT => 8],
192-
[\Memcached::OPT_RETRY_TIMEOUT => 10],
193-
];
194-
yield [
195-
'memcached://localhost:11222?socket_recv_size=1&socket_send_size=2',
196-
[\Memcached::OPT_RETRY_TIMEOUT => 8],
197-
[\Memcached::OPT_SOCKET_RECV_SIZE => 1, \Memcached::OPT_SOCKET_SEND_SIZE => 2, \Memcached::OPT_RETRY_TIMEOUT => 8],
198-
];
192+
$this->assertSame(1, $client->getOption(\Memcached::OPT_SOCKET_RECV_SIZE));
193+
$this->assertSame(2, $client->getOption(\Memcached::OPT_SOCKET_SEND_SIZE));
194+
$this->assertSame(8, $client->getOption(\Memcached::OPT_RETRY_TIMEOUT));
199195
}
200196

201197
public function testClear()

Traits/RedisTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ protected function doClear(string $namespace): bool
512512
continue;
513513
}
514514

515-
$cursor = null;
515+
$cursor = 0;
516516
do {
517517
$keys = $host instanceof \Predis\ClientInterface ? $host->scan($cursor, 'MATCH', $pattern, 'COUNT', 1000) : $host->scan($cursor, $pattern, 1000);
518518
if (isset($keys[1]) && \is_array($keys[1])) {

0 commit comments

Comments
 (0)
0