‪TYPO3CMS  11.5
VariableFrontendTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
22 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
23 
27 class ‪VariableFrontendTest extends FunctionalTestCase
28 {
30  {
31  $arrayToSerialize = [
32  'string' => 'Serialize a string',
33  'integer' => 0,
34  'anotherIntegerValue' => 123456,
35  'float' => 12.34,
36  'bool' => true,
37  'array' => [
38  0 => 'test',
39  1 => 'another test',
40  ],
41  ];
42 
43  return [
44  [
45  $arrayToSerialize,
46  'pages',
47  $arrayToSerialize,
48  ],
49  ];
50  }
51 
62  array $expected,
63  string $identifier,
64  array $arrayToSerialize
65  ): void {
66  $typo3DatabaseBackend = new ‪Typo3DatabaseBackend('Testing');
67  $subject = new ‪VariableFrontend($identifier, $typo3DatabaseBackend);
68 
69  $subject->set('myIdentifier', $arrayToSerialize);
70  self::assertSame($expected, $subject->get('myIdentifier'));
71  }
72 }
‪TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend
Definition: Typo3DatabaseBackend.php:30
‪TYPO3\CMS\Core\Tests\Functional\Cache\Frontend\VariableFrontendTest\insertSerializedArrayIntoLobAndRetrieveIt
‪insertSerializedArrayIntoLobAndRetrieveIt(array $expected, string $identifier, array $arrayToSerialize)
Definition: VariableFrontendTest.php:61
‪TYPO3\CMS\Core\Cache\Frontend\VariableFrontend
Definition: VariableFrontend.php:25
‪TYPO3\CMS\Core\Tests\Functional\Cache\Frontend
Definition: VariableFrontendTest.php:18
‪TYPO3\CMS\Core\Tests\Functional\Cache\Frontend\VariableFrontendTest
Definition: VariableFrontendTest.php:28
‪TYPO3\CMS\Core\Tests\Functional\Cache\Frontend\VariableFrontendTest\insertSerializedArrayIntoLobAndRetrieveItDataProvider
‪insertSerializedArrayIntoLobAndRetrieveItDataProvider()
Definition: VariableFrontendTest.php:29