‪TYPO3CMS  10.4
CheckValueTest.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 
25 {
29  protected ‪$scenarioDataSetDirectory = 'typo3/sysext/core/Tests/Functional/DataHandling/Regular/DataSet/';
30 
31  protected function ‪setUp(): void
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  $record = $this->‪insertRecordWithRadioFieldValue('predefined value');
45 
46  self::assertEquals('predefined value', $record['tx_testdatahandler_radio']);
47  }
48 
53  {
54  $record = $this->‪insertRecordWithRadioFieldValue('processed value');
55 
56  self::assertEquals('processed value', $record['tx_testdatahandler_radio']);
57  }
58 
63  {
64  $record = $this->‪insertRecordWithRadioFieldValue('some other value');
65 
66  self::assertEquals('', $record['tx_testdatahandler_radio']);
67  }
68 
72  protected function ‪insertRecordWithRadioFieldValue($value)
73  {
74  // pid 88 comes from LiveDefaultPages
75  $result = $this->actionService->createNewRecord('tt_content', 88, [
76  'tx_testdatahandler_radio' => $value
77  ]);
78  $recordUid = $result['tt_content'][0];
79 
80  $record = ‪BackendUtility::getRecord('tt_content', $recordUid);
81 
82  return $record;
83  }
84 }
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTest\insertRecordWithRadioFieldValue
‪array insertRecordWithRadioFieldValue($value)
Definition: CheckValueTest.php:71
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTest
Definition: CheckValueTest.php:25
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTest\radioButtonValueMustBeDefinedInTcaItems
‪radioButtonValueMustBeDefinedInTcaItems()
Definition: CheckValueTest.php:41
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTest\radioButtonValueIsNotSavedIfNotDefinedInTcaItemsOrProcessingItems
‪radioButtonValueIsNotSavedIfNotDefinedInTcaItemsOrProcessingItems()
Definition: CheckValueTest.php:61
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase
Definition: AbstractDataHandlerActionTestCase.php:37
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTest\radioButtonValueMustComeFromItemsProcFuncIfNotDefinedInTcaItems
‪radioButtonValueMustComeFromItemsProcFuncIfNotDefinedInTcaItems()
Definition: CheckValueTest.php:51
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTest\$scenarioDataSetDirectory
‪string $scenarioDataSetDirectory
Definition: CheckValueTest.php:28
‪TYPO3\CMS\Backend\Utility\BackendUtility
Definition: BackendUtility.php:75
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular
Definition: AbstractActionTestCase.php:16
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTest\setUp
‪setUp()
Definition: CheckValueTest.php:30
‪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\AbstractDataHandlerActionTestCase\importScenarioDataSet
‪importScenarioDataSet($dataSetName)
Definition: AbstractDataHandlerActionTestCase.php:201