‪TYPO3CMS  10.4
ActionTest.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 
19 
21 {
23  'workspaces',
24  ];
25 
29  protected ‪$pathsToLinkInTestInstance = [
30  'typo3/sysext/core/Tests/Functional/DataHandling/FlexformIrre/Fixtures/fileadmin' => 'fileadmin/fixture',
31  ];
32 
36  protected ‪$scenarioDataSetDirectory = 'typo3/sysext/core/Tests/Functional/DataHandling/FlexformIrre/DataSet/';
37 
42  protected ‪$assertCleanReferenceIndex = false;
43 
48  {
49  $this->‪importScenarioDataSet('LiveDefaultPages');
50  $this->‪importScenarioDataSet('LiveDefaultElements');
51  $this->‪setWorkspaceId(1);
52  $this->‪getActionService()->modifyRecords(1, [
53  //'sys_file_reference' => ['uid' => 10, 'hidden' => 0],
54  'tt_content' => ['uid' => 100, 'header' => 'Content #1 (WS)']
55  ]);
56 
57  // there should be one relation in the live WS and one in the draft WS pointing to the file field.
58  $queryBuilder = $this->getConnectionPool()
59  ->getQueryBuilderForTable('sys_file_reference');
60  $queryBuilder->getRestrictions()->removeAll();
61  $referenceCount = $queryBuilder
62  ->count('uid')
63  ->from('sys_file_reference')
64  ->where($queryBuilder->expr()->eq('uid_local', $queryBuilder->createNamedParameter(20, \PDO::PARAM_INT)))
65  ->execute()
66  ->fetchColumn(0);
67 
68  self::assertEquals(2, $referenceCount);
69  }
70 }
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\FlexformIrre\ActionTest\newVersionOfFileRelationInFlexformFieldIsCreatedOnSave
‪newVersionOfFileRelationInFlexformFieldIsCreatedOnSave()
Definition: ActionTest.php:44
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\FlexformIrre\ActionTest\$pathsToLinkInTestInstance
‪array $pathsToLinkInTestInstance
Definition: ActionTest.php:28
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\FlexformIrre\ActionTest\$coreExtensionsToLoad
‪$coreExtensionsToLoad
Definition: ActionTest.php:22
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase
Definition: AbstractDataHandlerActionTestCase.php:37
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\FlexformIrre\ActionTest\$assertCleanReferenceIndex
‪bool $assertCleanReferenceIndex
Definition: ActionTest.php:39
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\setWorkspaceId
‪setWorkspaceId(int $workspaceId)
Definition: AbstractDataHandlerActionTestCase.php:182
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\getActionService
‪ActionService getActionService()
Definition: AbstractDataHandlerActionTestCase.php:191
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\FlexformIrre\ActionTest\$scenarioDataSetDirectory
‪string $scenarioDataSetDirectory
Definition: ActionTest.php:34
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\FlexformIrre
Definition: ActionTest.php:16
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\FlexformIrre\ActionTest
Definition: ActionTest.php:21
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\importScenarioDataSet
‪importScenarioDataSet($dataSetName)
Definition: AbstractDataHandlerActionTestCase.php:201