3
3
* Copyright © 2016 Magento. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
-
7
6
namespace Magento \Deploy \Console \Command ;
8
7
9
8
use Magento \Framework \App \Utility \Files ;
19
18
use Magento \Framework \App \State ;
20
19
use Magento \Deploy \Console \Command \DeployStaticOptionsInterface as Options ;
21
20
use Magento \Deploy \Model \DeployManager ;
21
+ use Magento \Framework \App \Cache ;
22
+ use Magento \Framework \App \Cache \Type \Dummy as DummyCache ;
22
23
23
24
/**
24
25
* Deploy static content command
@@ -29,7 +30,7 @@ class DeployStaticContentCommand extends Command
29
30
/**
30
31
* Key for dry-run option
31
32
* @deprecated
32
- * @see Magento\Deploy\Console\Command\DeployStaticOptionsInterface::DRY_RUN
33
+ * @see \ Magento\Deploy\Console\Command\DeployStaticOptionsInterface::DRY_RUN
33
34
*/
34
35
const DRY_RUN_OPTION = 'dry-run ' ;
35
36
@@ -87,6 +88,7 @@ class DeployStaticContentCommand extends Command
87
88
* @param ObjectManagerFactory $objectManagerFactory
88
89
* @param Locale $validator
89
90
* @param ObjectManagerInterface $objectManager
91
+ * @throws \LogicException When the command name is empty
90
92
*/
91
93
public function __construct (
92
94
ObjectManagerFactory $ objectManagerFactory ,
@@ -96,6 +98,7 @@ public function __construct(
96
98
$ this ->objectManagerFactory = $ objectManagerFactory ;
97
99
$ this ->validator = $ validator ;
98
100
$ this ->objectManager = $ objectManager ;
101
+
99
102
parent ::__construct ();
100
103
}
101
104
@@ -373,6 +376,7 @@ private function getDeployableEntities($entities, $includedEntities, $excludedEn
373
376
/**
374
377
* {@inheritdoc}
375
378
* @throws \InvalidArgumentException
379
+ * @throws LocalizedException
376
380
*/
377
381
protected function execute (InputInterface $ input , OutputInterface $ output )
378
382
{
@@ -394,9 +398,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
394
398
list ($ deployableLanguages , $ deployableAreaThemeMap , $ requestedThemes )
395
399
= $ this ->prepareDeployableEntities ($ filesUtil );
396
400
397
- $ output ->writeln (" Requested languages: " . implode (', ' , $ deployableLanguages ));
398
- $ output ->writeln (" Requested areas: " . implode (', ' , array_keys ($ deployableAreaThemeMap )));
399
- $ output ->writeln (" Requested themes: " . implode (', ' , $ requestedThemes ));
401
+ $ output ->writeln (' Requested languages: ' . implode (', ' , $ deployableLanguages ));
402
+ $ output ->writeln (' Requested areas: ' . implode (', ' , array_keys ($ deployableAreaThemeMap )));
403
+ $ output ->writeln (' Requested themes: ' . implode (', ' , $ requestedThemes ));
400
404
401
405
/** @var $deployManager DeployManager */
402
406
$ deployManager = $ this ->objectManager ->create (
@@ -415,11 +419,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
415
419
}
416
420
}
417
421
422
+ $ this ->mockCache ();
418
423
return $ deployManager ->deploy ();
419
424
}
420
425
421
426
/**
422
427
* @param Files $filesUtil
428
+ * @throws \InvalidArgumentException
423
429
* @return array
424
430
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
425
431
* @SuppressWarnings(PHPMD.NPathComplexity)
@@ -476,4 +482,18 @@ private function prepareDeployableEntities($filesUtil)
476
482
477
483
return [$ deployableLanguages , $ deployableAreaThemeMap , $ requestedThemes ];
478
484
}
485
+
486
+ /**
487
+ * Mock Cache class with dummy implementation
488
+ *
489
+ * @return void
490
+ */
491
+ private function mockCache ()
492
+ {
493
+ $ this ->objectManager ->configure ([
494
+ 'preferences ' => [
495
+ Cache::class => DummyCache::class
496
+ ]
497
+ ]);
498
+ }
479
499
}
0 commit comments