‪TYPO3CMS  11.5
ActionTest.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 
22 
24 {
25  protected ‪$coreExtensionsToLoad = ['workspaces'];
26 
28  'typo3/sysext/core/Tests/Functional/DataHandling/FlexformIrre/Fixtures/fileadmin' => 'fileadmin/fixture',
29  ];
30 
32  'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_irre_foreignfield',
33  ];
34 
38  public function ‪verifyCleanReferenceIndex(): void
39  {
40  // The test verifies the imported data set has a clean reference index by the check in tearDown()
41  self::assertTrue(true);
42  }
43 
48  {
49  $this->importCSVDataSet(__DIR__ . '/DataSet/ImportDefault.csv');
50  $this->‪setWorkspaceId(1);
51  $this->actionService->modifyRecords(1, [
52  //'sys_file_reference' => ['uid' => 10, 'hidden' => 0],
53  'tt_content' => ['uid' => 100, 'header' => 'Content #1 (WS)'],
54  ]);
55 
56  // there should be one relation in the live WS and one in the draft WS pointing to the file field.
57  $queryBuilder = $this->getConnectionPool()
58  ->getQueryBuilderForTable('sys_file_reference');
59  $queryBuilder->getRestrictions()->removeAll();
60  $referenceCount = $queryBuilder
61  ->count('uid')
62  ->from('sys_file_reference')
63  ->where($queryBuilder->expr()->eq('uid_local', $queryBuilder->createNamedParameter(20, ‪Connection::PARAM_INT)))
64  ->executeQuery()
65  ->fetchOne();
66 
67  self::assertEquals(2, $referenceCount);
68  }
69 }
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\FlexformIrre\ActionTest\newVersionOfFileRelationInFlexformFieldIsCreatedOnSave
‪newVersionOfFileRelationInFlexformFieldIsCreatedOnSave()
Definition: ActionTest.php:47
‪TYPO3\CMS\Core\Database\Connection\PARAM_INT
‪const PARAM_INT
Definition: Connection.php:49
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\FlexformIrre\ActionTest\$coreExtensionsToLoad
‪$coreExtensionsToLoad
Definition: ActionTest.php:25
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase
Definition: AbstractDataHandlerActionTestCase.php:41
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\FlexformIrre\ActionTest\$pathsToLinkInTestInstance
‪$pathsToLinkInTestInstance
Definition: ActionTest.php:27
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\FlexformIrre\ActionTest\verifyCleanReferenceIndex
‪verifyCleanReferenceIndex()
Definition: ActionTest.php:38
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\setWorkspaceId
‪setWorkspaceId(int $workspaceId)
Definition: AbstractDataHandlerActionTestCase.php:166
‪TYPO3\CMS\Core\Database\Connection
Definition: Connection.php:38
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\FlexformIrre\ActionTest\$testExtensionsToLoad
‪$testExtensionsToLoad
Definition: ActionTest.php:31
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\FlexformIrre
Definition: ActionTest.php:18
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\FlexformIrre\ActionTest
Definition: ActionTest.php:24