c4d0173e168a86aa8c2874e9d7dff2e569383126
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Tests / UnitDeprecated / Mvc / Cli / CommandTest.php
1 <?php
2 declare(strict_types = 1);
3
4 namespace TYPO3\CMS\Extbase\Tests\UnitDeprecated\Mvc\Cli;
5
6 /*
7 * This file is part of the TYPO3 CMS project.
8 *
9 * It is free software; you can redistribute it and/or modify it under
10 * the terms of the GNU General Public License, either version 2
11 * of the License, or any later version.
12 *
13 * For the full copyright and license information, please read the
14 * LICENSE.txt file that was distributed with this source code.
15 *
16 * The TYPO3 project - inspiring people to share!
17 */
18
19 use TYPO3\CMS\Core\Utility\GeneralUtility;
20 use TYPO3\CMS\Extbase\Mvc\Cli\Command;
21 use TYPO3\CMS\Extbase\Object\ObjectManager;
22 use TYPO3\CMS\Extbase\Tests\UnitDeprecated\Mvc\Cli\Fixture\Command\MockCCommandController;
23 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
24
25 /**
26 * Test case
27 */
28 class CommandTest extends UnitTestCase
29 {
30 /**
31 * @var bool Reset singletons created by subject
32 */
33 protected $resetSingletonInstances = true;
34
35 public function testIsCliOnly()
36 {
37 $commandController = GeneralUtility::makeInstance(ObjectManager::class)->get(
38 Command::class,
39 MockCCommandController::class,
40 'empty'
41 );
42
43 static::assertFalse($commandController->isCliOnly());
44
45 $commandController = GeneralUtility::makeInstance(ObjectManager::class)->get(
46 Command::class,
47 MockCCommandController::class,
48 'cliOnly'
49 );
50
51 static::assertTrue($commandController->isCliOnly());
52 }
53 }