‪TYPO3CMS  10.4
CheckValueTestForCheckboxes.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 
27 {
28 
32  protected ‪$scenarioDataSetDirectory = 'typo3/sysext/core/Tests/Functional/DataHandling/Regular/DataSet/';
33 
34  protected function ‪setUp(): void
35  {
36  $this->testExtensionsToLoad[] = 'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_datahandler';
37 
38  parent::setUp();
39  $this->‪importScenarioDataSet('LiveDefaultPages');
40  }
41 
46  {
47  // pid 88 comes from LiveDefaultPages
48  $result = $this->actionService->createNewRecord('tt_content', 88, [
49  'tx_testdatahandler_checkbox' => '1'
50  ]);
51  $recordUid = $result['tt_content'][0];
52 
53  $record = ‪BackendUtility::getRecord('tt_content', $recordUid);
54 
55  self::assertEquals(1, $record['tx_testdatahandler_checkbox']);
56  }
57 
62  {
63  // pid 88 comes from LiveDefaultPages
64  $result = $this->actionService->createNewRecord('tt_content', 88, [
65  'tx_testdatahandler_checkbox' => '2'
66  ]);
67  $recordUid = $result['tt_content'][0];
68 
69  $record = ‪BackendUtility::getRecord('tt_content', $recordUid);
70 
71  self::assertEquals(2, $record['tx_testdatahandler_checkbox']);
72  }
73 }
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTestForCheckboxes\setUp
‪setUp()
Definition: CheckValueTestForCheckboxes.php:33
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTestForCheckboxes\$scenarioDataSetDirectory
‪string $scenarioDataSetDirectory
Definition: CheckValueTestForCheckboxes.php:31
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTestForCheckboxes\checkBoxValueMustBeDefinedInTcaItems
‪checkBoxValueMustBeDefinedInTcaItems()
Definition: CheckValueTestForCheckboxes.php:44
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase
Definition: AbstractDataHandlerActionTestCase.php:37
‪TYPO3\CMS\Backend\Utility\BackendUtility
Definition: BackendUtility.php:75
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular
Definition: AbstractActionTestCase.php:16
‪TYPO3\CMS\Backend\Utility\BackendUtility\getRecord
‪static array null getRecord($table, $uid, $fields=' *', $where='', $useDeleteClause=true)
Definition: BackendUtility.php:95
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTestForCheckboxes\checkBoxValueMustComeFromItemsProcFuncIfNotDefinedInTcaItems
‪checkBoxValueMustComeFromItemsProcFuncIfNotDefinedInTcaItems()
Definition: CheckValueTestForCheckboxes.php:60
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTestForCheckboxes
Definition: CheckValueTestForCheckboxes.php:27
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\importScenarioDataSet
‪importScenarioDataSet($dataSetName)
Definition: AbstractDataHandlerActionTestCase.php:201