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