TYPO3 CMS  TYPO3_7-6
CheckValueTestForCheckboxes.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
18 
23 {
24 
28  protected $scenarioDataSetDirectory = 'typo3/sysext/core/Tests/Functional/DataHandling/Regular/DataSet/';
29 
30  protected function setUp()
31  {
32  $this->testExtensionsToLoad[] = 'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_datahandler';
33 
34  parent::setUp();
35  $this->importScenarioDataSet('LiveDefaultPages');
36  }
37 
42  {
43  // pid 88 comes from LiveDefaultPages
44  $result = $this->actionService->createNewRecord('tt_content', 88, [
45  'tx_testdatahandler_checkbox' => '1'
46  ]);
47  $recordUid = $result['tt_content'][0];
48 
49  $record = BackendUtility::getRecord('tt_content', $recordUid);
50 
51  $this->assertEquals(1, $record['tx_testdatahandler_checkbox']);
52  }
53 
58  {
59  // pid 88 comes from LiveDefaultPages
60  $result = $this->actionService->createNewRecord('tt_content', 88, [
61  'tx_testdatahandler_checkbox' => '2'
62  ]);
63  $recordUid = $result['tt_content'][0];
64 
65  $record = BackendUtility::getRecord('tt_content', $recordUid);
66 
67  $this->assertEquals(2, $record['tx_testdatahandler_checkbox']);
68  }
69 }
static getRecord($table, $uid, $fields=' *', $where='', $useDeleteClause=true)