‪TYPO3CMS  11.5
WorkspaceNewPlaceholderRemovalTest.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 PHPUnit\Framework\MockObject\MockObject;
24 use TYPO3\TestingFramework\Core\Functional\Framework\DataHandling\ActionService;
25 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
26 
27 class ‪WorkspaceNewPlaceholderRemovalTest extends FunctionalTestCase
28 {
29  protected ‪$coreExtensionsToLoad = ['workspaces'];
30 
32  'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_irre_foreignfield',
33  'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_irre_csv',
34  ];
35 
39  protected ‪$subject;
40 
41  protected ActionService ‪$actionService;
42 
43  protected function ‪setUp(): void
44  {
45  parent::setUp();
46  $this->actionService = GeneralUtility::makeInstance(ActionService::class);
47  // Register only WorkspaceNewPlaceholderRemovalMigration in the row updater wizard
48  $this->subject = $this->getAccessibleMock(DatabaseRowsUpdateWizard::class, ['dummy']);
49  $this->subject->_set('rowUpdater', [WorkspaceNewPlaceholderRemovalMigration::class]);
50  }
51 
55  public function ‪workspaceRecordsUpdatedWithIrreCsv(): void
56  {
57  // Data set inspired by workspaces IRRE/CSV/Modify/DataSet/copyPage.csv
58  $this->importCSVDataSet(__DIR__ . '/Fixtures/WorkspaceNewPlaceholderRemovalIrreCsvImport.csv');
59  $this->subject->executeUpdate();
60  $this->assertCSVDataSet(__DIR__ . '/Fixtures/WorkspaceNewPlaceholderRemovalIrreCsvResult.csv');
61  }
62 
67  {
68  // Data set inspired by workspaces IRRE/ForeignField/Modify/DataSet/copyPage.csv
69  $this->importCSVDataSet(__DIR__ . '/Fixtures/WorkspaceNewPlaceholderRemovalIrreForeignFieldImport.csv');
70  $this->subject->executeUpdate();
71  $this->assertCSVDataSet(__DIR__ . '/Fixtures/WorkspaceNewPlaceholderRemovalIrreForeignFieldResult.csv');
72  }
73 
77  public function ‪workspaceRecordsUpdatedWithManyToMany(): void
78  {
79  // Data set inspired by workspaces ManyToMany/Modify/DataSet/copyPage.csv
80  $this->importCSVDataSet(__DIR__ . '/Fixtures/WorkspaceNewPlaceholderRemovalManyToManyImport.csv');
81  $this->subject->executeUpdate();
82  $this->assertCSVDataSet(__DIR__ . '/Fixtures/WorkspaceNewPlaceholderRemovalManyToManyResult.csv');
83  }
84 }
‪TYPO3\CMS\Install\Tests\Functional\Updates\RowUpdater\WorkspaceNewPlaceholderRemovalTest\$actionService
‪ActionService $actionService
Definition: WorkspaceNewPlaceholderRemovalTest.php:40
‪TYPO3\CMS\Install\Tests\Functional\Updates\RowUpdater
Definition: WorkspaceNewPlaceholderRemovalTest.php:18
‪TYPO3\CMS\Install\Tests\Functional\Updates\RowUpdater\WorkspaceNewPlaceholderRemovalTest\setUp
‪setUp()
Definition: WorkspaceNewPlaceholderRemovalTest.php:42
‪TYPO3\CMS\Install\Updates\DatabaseRowsUpdateWizard
Definition: DatabaseRowsUpdateWizard.php:50
‪TYPO3\CMS\Install\Updates\RowUpdater\WorkspaceNewPlaceholderRemovalMigration
Definition: WorkspaceNewPlaceholderRemovalMigration.php:44
‪TYPO3\CMS\Install\Tests\Functional\Updates\RowUpdater\WorkspaceNewPlaceholderRemovalTest\workspaceRecordsUpdatedWithManyToMany
‪workspaceRecordsUpdatedWithManyToMany()
Definition: WorkspaceNewPlaceholderRemovalTest.php:76
‪TYPO3\CMS\Install\Tests\Functional\Updates\RowUpdater\WorkspaceNewPlaceholderRemovalTest
Definition: WorkspaceNewPlaceholderRemovalTest.php:28
‪TYPO3\CMS\Install\Tests\Functional\Updates\RowUpdater\WorkspaceNewPlaceholderRemovalTest\$testExtensionsToLoad
‪$testExtensionsToLoad
Definition: WorkspaceNewPlaceholderRemovalTest.php:31
‪TYPO3\CMS\Install\Tests\Functional\Updates\RowUpdater\WorkspaceNewPlaceholderRemovalTest\$subject
‪MockObject DatabaseRowsUpdateWizard TYPO3 TestingFramework Core AccessibleObjectInterface $subject
Definition: WorkspaceNewPlaceholderRemovalTest.php:38
‪TYPO3\CMS\Install\Tests\Functional\Updates\RowUpdater\WorkspaceNewPlaceholderRemovalTest\$coreExtensionsToLoad
‪$coreExtensionsToLoad
Definition: WorkspaceNewPlaceholderRemovalTest.php:29
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:50
‪TYPO3\CMS\Install\Tests\Functional\Updates\RowUpdater\WorkspaceNewPlaceholderRemovalTest\workspaceRecordsUpdatedWithIrreForeignField
‪workspaceRecordsUpdatedWithIrreForeignField()
Definition: WorkspaceNewPlaceholderRemovalTest.php:65
‪TYPO3\CMS\Install\Tests\Functional\Updates\RowUpdater\WorkspaceNewPlaceholderRemovalTest\workspaceRecordsUpdatedWithIrreCsv
‪workspaceRecordsUpdatedWithIrreCsv()
Definition: WorkspaceNewPlaceholderRemovalTest.php:54