TYPO3 CMS  TYPO3_8-7
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 }
static getRecord($table, $uid, $fields=' *', $where='', $useDeleteClause=true)