‪TYPO3CMS  9.5
CheckValueTestForCheckboxes.php
Go to the documentation of this file.
1 <?php
2 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  */
19 
24 {
25 
29  protected ‪$scenarioDataSetDirectory = 'typo3/sysext/core/Tests/Functional/DataHandling/Regular/DataSet/';
30 
31  protected function ‪setUp()
32  {
33  $this->testExtensionsToLoad[] = 'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_datahandler';
34 
35  parent::setUp();
36  $this->‪importScenarioDataSet('LiveDefaultPages');
37  }
38 
43  {
44  // pid 88 comes from LiveDefaultPages
45  $result = $this->actionService->createNewRecord('tt_content', 88, [
46  'tx_testdatahandler_checkbox' => '1'
47  ]);
48  $recordUid = $result['tt_content'][0];
49 
50  $record = ‪BackendUtility::getRecord('tt_content', $recordUid);
51 
52  $this->assertEquals(1, $record['tx_testdatahandler_checkbox']);
53  }
54 
59  {
60  // pid 88 comes from LiveDefaultPages
61  $result = $this->actionService->createNewRecord('tt_content', 88, [
62  'tx_testdatahandler_checkbox' => '2'
63  ]);
64  $recordUid = $result['tt_content'][0];
65 
66  $record = ‪BackendUtility::getRecord('tt_content', $recordUid);
67 
68  $this->assertEquals(2, $record['tx_testdatahandler_checkbox']);
69  }
70 }
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTestForCheckboxes\setUp
‪setUp()
Definition: CheckValueTestForCheckboxes.php:30
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTestForCheckboxes\$scenarioDataSetDirectory
‪string $scenarioDataSetDirectory
Definition: CheckValueTestForCheckboxes.php:28
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTestForCheckboxes\checkBoxValueMustBeDefinedInTcaItems
‪checkBoxValueMustBeDefinedInTcaItems()
Definition: CheckValueTestForCheckboxes.php:41
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase
Definition: AbstractDataHandlerActionTestCase.php:33
‪TYPO3\CMS\Backend\Utility\BackendUtility
Definition: BackendUtility.php:72
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular
Definition: AbstractActionTestCase.php:2
‪TYPO3\CMS\Backend\Utility\BackendUtility\getRecord
‪static array null getRecord($table, $uid, $fields=' *', $where='', $useDeleteClause=true)
Definition: BackendUtility.php:130
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTestForCheckboxes\checkBoxValueMustComeFromItemsProcFuncIfNotDefinedInTcaItems
‪checkBoxValueMustComeFromItemsProcFuncIfNotDefinedInTcaItems()
Definition: CheckValueTestForCheckboxes.php:57
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTestForCheckboxes
Definition: CheckValueTestForCheckboxes.php:24
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\importScenarioDataSet
‪importScenarioDataSet($dataSetName)
Definition: AbstractDataHandlerActionTestCase.php:117