‪TYPO3CMS  11.5
CheckValueTest.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  $record = $this->‪insertRecordWithRadioFieldValue('predefined value');
44 
45  self::assertEquals('predefined value', $record['tx_testdatahandler_radio']);
46  }
47 
52  {
53  $record = $this->‪insertRecordWithRadioFieldValue('processed value');
54 
55  self::assertEquals('processed value', $record['tx_testdatahandler_radio']);
56  }
57 
62  {
63  $record = $this->‪insertRecordWithRadioFieldValue('some other value');
64 
65  self::assertEquals('', $record['tx_testdatahandler_radio']);
66  }
67 
71  protected function ‪insertRecordWithRadioFieldValue($value): array
72  {
73  // pid 88 comes from ImportDefault
74  $result = $this->actionService->createNewRecord('tt_content', 88, [
75  'tx_testdatahandler_radio' => $value,
76  ]);
77  $recordUid = $result['tt_content'][0];
78 
79  $record = BackendUtility::getRecord('tt_content', $recordUid);
80 
81  return $record;
82  }
83 }
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTest\$testExtensionsToLoad
‪$testExtensionsToLoad
Definition: CheckValueTest.php:28
‪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:27
‪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:41
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTest\radioButtonValueMustComeFromItemsProcFuncIfNotDefinedInTcaItems
‪radioButtonValueMustComeFromItemsProcFuncIfNotDefinedInTcaItems()
Definition: CheckValueTest.php:51
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular
Definition: AbstractActionTestCase.php:18
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTest\setUp
‪setUp()
Definition: CheckValueTest.php:32