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