Upgrade 1-11.38

This commit is contained in:
xesmyd
2026-03-30 14:10:30 +02:00
parent f2a7e6d1fc
commit ac648ef29d
24665 changed files with 69682 additions and 2205004 deletions
+11 -47
View File
@@ -23,7 +23,7 @@ class MemcachedAdapterTest extends AdapterTestCase
protected static $client;
public static function setUpBeforeClass(): void
public static function setUpBeforeClass()
{
if (!MemcachedAdapter::isSupported()) {
self::markTestSkipped('Extension memcached >=2.2.0 required.');
@@ -66,8 +66,14 @@ class MemcachedAdapterTest extends AdapterTestCase
*/
public function testBadOptions($name, $value)
{
$this->expectException('ErrorException');
$this->expectExceptionMessage('constant(): Couldn\'t find constant Memcached::');
if (\PHP_VERSION_ID < 80000) {
$this->expectException('ErrorException');
$this->expectExceptionMessage('constant(): Couldn\'t find constant Memcached::');
} else {
$this->expectException('Error');
$this->expectExceptionMessage('Undefined constant Memcached::');
}
MemcachedAdapter::createConnection([], [$name => $value]);
}
@@ -135,7 +141,7 @@ class MemcachedAdapterTest extends AdapterTestCase
'localhost',
11222,
];
if (filter_var(ini_get('memcached.use_sasl'), FILTER_VALIDATE_BOOLEAN)) {
if (filter_var(ini_get('memcached.use_sasl'), \FILTER_VALIDATE_BOOLEAN)) {
yield [
'memcached://user:password@127.0.0.1?weight=50',
'127.0.0.1',
@@ -152,7 +158,7 @@ class MemcachedAdapterTest extends AdapterTestCase
'/var/local/run/memcached.socket',
0,
];
if (filter_var(ini_get('memcached.use_sasl'), FILTER_VALIDATE_BOOLEAN)) {
if (filter_var(ini_get('memcached.use_sasl'), \FILTER_VALIDATE_BOOLEAN)) {
yield [
'memcached://user:password@/var/local/run/memcached.socket?weight=25',
'/var/local/run/memcached.socket',
@@ -195,46 +201,4 @@ class MemcachedAdapterTest extends AdapterTestCase
{
$this->assertTrue($this->createCachePool()->clear());
}
public function testMultiServerDsn()
{
$dsn = 'memcached:?host[localhost]&host[localhost:12345]&host[/some/memcached.sock:]=3';
$client = MemcachedAdapter::createConnection($dsn);
$expected = [
0 => [
'host' => 'localhost',
'port' => 11211,
'type' => 'TCP',
],
1 => [
'host' => 'localhost',
'port' => 12345,
'type' => 'TCP',
],
2 => [
'host' => '/some/memcached.sock',
'port' => 0,
'type' => 'SOCKET',
],
];
$this->assertSame($expected, $client->getServerList());
$dsn = 'memcached://localhost?host[foo.bar]=3';
$client = MemcachedAdapter::createConnection($dsn);
$expected = [
0 => [
'host' => 'localhost',
'port' => 11211,
'type' => 'TCP',
],
1 => [
'host' => 'foo.bar',
'port' => 11211,
'type' => 'TCP',
],
];
$this->assertSame($expected, $client->getServerList());
}
}