‪TYPO3CMS  ‪main
CommandCest.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 Codeception\Example;
22 
26 final class ‪CommandCest
27 {
35  private function ‪commandTestDataProvider(): array
36  {
37  return [
38  ['command' => 'cache:flush', 'code' => 0],
39  ['command' => 'cache:warmup', 'code' => 0],
40  ['command' => 'cleanup:flexforms', 'code' => 0],
41  ['command' => 'cleanup:deletedrecords', 'code' => 0],
42  ['command' => 'cleanup:localprocessedfiles --dry-run -v', 'code' => 0],
43  ['command' => 'cleanup:missingrelations --dry-run --update-refindex', 'code' => 0],
44  ['command' => 'cleanup:orphanrecords', 'code' => 0],
45  ['command' => 'cleanup:previewlinks', 'code' => 0],
46  ['command' => 'cleanup:versions', 'code' => 0],
47  ['command' => 'extension:list', 'code' => 0],
48  ['command' => 'extension:setup', 'code' => 0],
49  ['command' => 'extension:deactivate workspaces', 'code' => 0],
50  ['command' => 'extension:activate workspaces', 'code' => 0],
51  ['command' => 'language:update', 'code' => 0],
52  ['command' => 'mailer:spool:send', 'code' => 1],
53  ['command' => 'redirects:checkintegrity', 'code' => 0],
54  ['command' => 'redirects:cleanup', 'code' => 0],
55  ['command' => 'referenceindex:update --check', 'code' => 0],
56  ['command' => 'scheduler:run', 'code' => 0],
57  ['command' => 'site:list', 'code' => 0],
58  ['command' => 'site:show styleguide-demo-51', 'code' => 0],
59  ['command' => 'syslog:list', 'code' => 0],
60  ['command' => 'upgrade:list', 'code' => 0],
61  ];
62  }
63 
67  public function ‪runCommand(‪ApplicationTester $I, Example $testData): void
68  {
69  $I->runShellCommand('../../../../bin/typo3 ' . $testData['command'], false);
70  $I->seeResultCodeIs($testData['code']);
71  }
72 }
‪TYPO3\CMS\Core\Tests\Acceptance\Support\ApplicationTester
Definition: ApplicationTester.php:28
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Cli\CommandCest\commandTestDataProvider
‪commandTestDataProvider()
Definition: CommandCest.php:35
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Cli\CommandCest
Definition: CommandCest.php:27
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Cli\CommandCest\runCommand
‪runCommand(ApplicationTester $I, Example $testData)
Definition: CommandCest.php:67
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Cli
Definition: CommandCest.php:18