[BUGFIX] Add missing namespace parts
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Functional / Cache / Frontend / VariableFrontendTest.php
1 <?php
2 namespace TYPO3\CMS\Core\Tests\Functional\Cache\Frontend;
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
17 use TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend;
18 use TYPO3\CMS\Core\Cache\Frontend\VariableFrontend;
19
20 /**
21 * Test case
22 */
23 class VariableFrontendTest extends \TYPO3\Components\TestingFramework\Core\Functional\FunctionalTestCase
24 {
25 public function insertSerializedArrayIntoLobAndRetrieveItDataProvider()
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
48 /**
49 * @dataProvider insertSerializedArrayIntoLobAndRetrieveItDataProvider
50 *
51 * @test
52 *
53 * @param array $expected
54 * @param string $identifier
55 * @param array $arrayToSerialize
56 */
57 public function insertSerializedArrayIntoLobAndRetrieveIt(
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 }