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
+10 -37
View File
@@ -12,7 +12,6 @@
namespace Symfony\Component\Cache\Tests\Adapter;
use Psr\Cache\CacheItemInterface;
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
use Symfony\Component\Cache\Adapter\NullAdapter;
use Symfony\Component\Cache\Adapter\PhpArrayAdapter;
@@ -22,8 +21,6 @@ use Symfony\Component\Cache\Adapter\PhpArrayAdapter;
class PhpArrayAdapterTest extends AdapterTestCase
{
protected $skippedTests = [
'testGet' => 'PhpArrayAdapter is read-only.',
'testRecursiveGet' => 'PhpArrayAdapter is read-only.',
'testBasicUsage' => 'PhpArrayAdapter is read-only.',
'testBasicUsageWithLongKey' => 'PhpArrayAdapter is read-only.',
'testClear' => 'PhpArrayAdapter is read-only.',
@@ -58,12 +55,12 @@ class PhpArrayAdapterTest extends AdapterTestCase
protected static $file;
public static function setUpBeforeClass(): void
public static function setUpBeforeClass()
{
self::$file = sys_get_temp_dir().'/symfony-cache/php-array-adapter-test.php';
}
protected function tearDown(): void
protected function tearDown()
{
$this->createCachePool()->clear();
@@ -72,12 +69,8 @@ class PhpArrayAdapterTest extends AdapterTestCase
}
}
public function createCachePool($defaultLifetime = 0, $testMethod = null)
public function createCachePool()
{
if ('testGetMetadata' === $testMethod) {
return new PhpArrayAdapter(self::$file, new FilesystemAdapter());
}
return new PhpArrayAdapterWrapper(self::$file, new NullAdapter());
}
@@ -110,32 +103,16 @@ class PhpArrayAdapterTest extends AdapterTestCase
public function testStoredFile()
{
$data = [
$expected = [
'integer' => 42,
'float' => 42.42,
'boolean' => true,
'array_simple' => ['foo', 'bar'],
'array_associative' => ['foo' => 'bar', 'foo2' => 'bar2'],
];
$expected = [
[
'integer' => 0,
'float' => 1,
'boolean' => 2,
'array_simple' => 3,
'array_associative' => 4,
],
[
0 => 42,
1 => 42.42,
2 => true,
3 => ['foo', 'bar'],
4 => ['foo' => 'bar', 'foo2' => 'bar2'],
],
];
$adapter = $this->createCachePool();
$adapter->warmUp($data);
$adapter->warmUp($expected);
$values = eval(substr(file_get_contents(self::$file), 6));
@@ -145,17 +122,13 @@ class PhpArrayAdapterTest extends AdapterTestCase
class PhpArrayAdapterWrapper extends PhpArrayAdapter
{
protected $data = [];
public function save(CacheItemInterface $item)
{
(\Closure::bind(function () use ($item) {
$key = $item->getKey();
$this->keys[$key] = $id = \count($this->values);
$this->data[$key] = $this->values[$id] = $item->get();
$this->warmUp($this->data);
list($this->keys, $this->values) = eval(substr(file_get_contents($this->file), 6));
}, $this, PhpArrayAdapter::class))();
\call_user_func(\Closure::bind(function () use ($item) {
$this->values[$item->getKey()] = $item->get();
$this->warmUp($this->values);
$this->values = eval(substr(file_get_contents($this->file), 6));
}, $this, PhpArrayAdapter::class));
return true;
}