-
-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathAbstractCommandTestCase.php
More file actions
57 lines (42 loc) · 1.49 KB
/
AbstractCommandTestCase.php
File metadata and controls
57 lines (42 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
declare(strict_types=1);
namespace Extcode\Cart\Tests\Functional\Command;
/*
* This file is part of the package extcode/cart.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
use Codappix\Typo3PhpDatasets\TestingFramework;
use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
abstract class AbstractCommandTestCase extends FunctionalTestCase
{
use TestingFramework;
private const FORM_PROTECTION_SESSION_TOKEN = 'testtoken';
protected function setUp(): void
{
$this->testExtensionsToLoad = [
'extcode/cart',
];
$this->coreExtensionsToLoad = [
'typo3/cms-beuser',
'typo3/cms-core',
];
$this->pathsToLinkInTestInstance['typo3conf/ext/cart/Tests/Functional/Fixtures/Import/Sites/'] = 'typo3conf/sites';
parent::setUp();
$this->importPHPDataSet(__DIR__ . '/../../Fixtures/BaseDatabase.php');
$this->importPHPDataSet(__DIR__ . '/../../Fixtures/BackendUser.php');
$this->setUpBackendUser(1)
->getSession()
->set('formProtectionSessionToken', self::FORM_PROTECTION_SESSION_TOKEN);
$GLOBALS['LANG'] = $this->get(LanguageServiceFactory::class)->create('en');
}
protected function tearDown(): void
{
unset(
$GLOBALS['LANG']
);
parent::tearDown();
}
}