‪TYPO3CMS  11.5
CheckValueTestForCheckboxesTest.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 
20 use TYPO3\CMS\Backend\Utility\BackendUtility;
22 
27 {
29  'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_datahandler',
30  ];
31 
32  protected function ‪setUp(): void
33  {
34  parent::setUp();
35  $this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefault.csv');
36  }
37 
42  {
43  // pid 88 comes from ImportDefault
44  $result = $this->actionService->createNewRecord('tt_content', 88, [
45  'tx_testdatahandler_checkbox' => '1',
46  ]);
47  $recordUid = $result['tt_content'][0];
48 
49  $record = BackendUtility::getRecord('tt_content', $recordUid);
50 
51  self::assertEquals(1, $record['tx_testdatahandler_checkbox']);
52  }
53 
58  {
59  // pid 88 comes from ImportDefault
60  $result = $this->actionService->createNewRecord('tt_content', 88, [
61  'tx_testdatahandler_checkbox' => '2',
62  ]);
63  $recordUid = $result['tt_content'][0];
64 
65  $record = BackendUtility::getRecord('tt_content', $recordUid);
66 
67  self::assertEquals(2, $record['tx_testdatahandler_checkbox']);
68  }
69 }
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTestForCheckboxesTest\setUp
‪setUp()
Definition: CheckValueTestForCheckboxesTest.php:32
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTestForCheckboxesTest
Definition: CheckValueTestForCheckboxesTest.php:27
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase
Definition: AbstractDataHandlerActionTestCase.php:41
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTestForCheckboxesTest\checkBoxValueMustBeDefinedInTcaItems
‪checkBoxValueMustBeDefinedInTcaItems()
Definition: CheckValueTestForCheckboxesTest.php:41
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular
Definition: AbstractActionTestCase.php:18
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTestForCheckboxesTest\$testExtensionsToLoad
‪$testExtensionsToLoad
Definition: CheckValueTestForCheckboxesTest.php:28
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTestForCheckboxesTest\checkBoxValueMustComeFromItemsProcFuncIfNotDefinedInTcaItems
‪checkBoxValueMustComeFromItemsProcFuncIfNotDefinedInTcaItems()
Definition: CheckValueTestForCheckboxesTest.php:57