[TASK] Raise testing-framework and styleguide
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Acceptance / Support / Extension / BackendCoreEnvironment.php
1 <?php
2 declare(strict_types = 1);
3 namespace TYPO3\CMS\Core\Tests\Acceptance\Support\Extension;
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
18 use Codeception\Event\SuiteEvent;
19 use TYPO3\CMS\Core\Core\Bootstrap;
20 use TYPO3\CMS\Styleguide\TcaDataGenerator\Generator;
21 use TYPO3\TestingFramework\Core\Acceptance\Extension\BackendEnvironment;
22
23 /**
24 * Load various core extensions and styleguide and call styleguide generator
25 */
26 class BackendCoreEnvironment extends BackendEnvironment
27 {
28 /**
29 * Load a list of core extensions and styleguide
30 *
31 * @var array
32 */
33 protected $localConfig = [
34 'coreExtensionsToLoad' => [
35 'core',
36 'beuser',
37 'extbase',
38 'fluid',
39 'filelist',
40 'extensionmanager',
41 'setup',
42 'rsaauth',
43 'backend',
44 'about',
45 'belog',
46 'install',
47 'frontend',
48 'recordlist',
49 'redirects',
50 'reports',
51 'sys_note',
52 'scheduler',
53 'tstemplate',
54 ],
55 'testExtensionsToLoad' => [
56 'typo3conf/ext/styleguide'
57 ],
58 'xmlDatabaseFixtures' => [
59 'PACKAGE:typo3/testing-framework/Resources/Core/Acceptance/Fixtures/be_users.xml',
60 'PACKAGE:typo3/testing-framework/Resources/Core/Acceptance/Fixtures/be_sessions.xml',
61 'PACKAGE:typo3/testing-framework/Resources/Core/Acceptance/Fixtures/be_groups.xml',
62 'PACKAGE:typo3/testing-framework/Resources/Core/Acceptance/Fixtures/sys_category.xml',
63 'PACKAGE:typo3/testing-framework/Resources/Core/Acceptance/Fixtures/tx_extensionmanager_domain_model_extension.xml',
64 'PACKAGE:typo3/testing-framework/Resources/Core/Acceptance/Fixtures/tx_extensionmanager_domain_model_repository.xml',
65 ],
66 ];
67
68 /**
69 * Generate styleguide data
70 *
71 * @param SuiteEvent $suiteEvent
72 */
73 public function bootstrapTypo3Environment(SuiteEvent $suiteEvent)
74 {
75 parent::bootstrapTypo3Environment($suiteEvent);
76 // styleguide generator uses DataHandler for some parts. DataHandler needs an initialized BE user
77 // with admin right and the live workspace.
78 Bootstrap::initializeBackendUser();
79 $GLOBALS['BE_USER']->user['admin'] = 1;
80 $GLOBALS['BE_USER']->user['uid'] = 1;
81 $GLOBALS['BE_USER']->workspace = 0;
82 Bootstrap::initializeLanguageObject();
83
84 $styleguideGenerator = new Generator();
85 $styleguideGenerator->create();
86 }
87 }