‪TYPO3CMS  11.5
CheckValueTestForSelectTest.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 
41  public function ‪selectValueMustBeDefinedInTcaItems(): void
42  {
43  // pid 88 comes from ImportDefault
44  $result = $this->actionService->createNewRecord('tt_content', 88, [
45  'tx_testdatahandler_select_dynamic' => 'predefined value',
46  ]);
47  $recordUid = $result['tt_content'][0];
48 
49  $record = BackendUtility::getRecord('tt_content', $recordUid);
50 
51  self::assertEquals('predefined value', $record['tx_testdatahandler_select_dynamic']);
52  }
53 
58  {
59  // pid 88 comes from ImportDefault
60  $result = $this->actionService->createNewRecord('tt_content', 88, [
61  'tx_testdatahandler_select_dynamic' => 'processed value',
62  ]);
63  $recordUid = $result['tt_content'][0];
64 
65  $record = BackendUtility::getRecord('tt_content', $recordUid);
66 
67  self::assertEquals('processed value', $record['tx_testdatahandler_select_dynamic']);
68  }
69 }
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase
Definition: AbstractDataHandlerActionTestCase.php:41
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTestForSelectTest\selectValueMustBeDefinedInTcaItems
‪selectValueMustBeDefinedInTcaItems()
Definition: CheckValueTestForSelectTest.php:41
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular
Definition: AbstractActionTestCase.php:18
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTestForSelectTest\selectValueMustComeFromItemsProcFuncIfNotDefinedInTcaItems
‪selectValueMustComeFromItemsProcFuncIfNotDefinedInTcaItems()
Definition: CheckValueTestForSelectTest.php:57
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTestForSelectTest\$testExtensionsToLoad
‪$testExtensionsToLoad
Definition: CheckValueTestForSelectTest.php:28
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTestForSelectTest
Definition: CheckValueTestForSelectTest.php:27
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\CheckValueTestForSelectTest\setUp
‪setUp()
Definition: CheckValueTestForSelectTest.php:32