17
17
18
18
/**
19
19
* Command generates fixtures for performance tests
20
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
20
21
*/
21
22
class GenerateFixturesCommand extends Command
22
23
{
@@ -83,6 +84,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
83
84
$ fixture ->printInfo ($ output );
84
85
}
85
86
87
+ /** @var \Magento\Setup\Fixtures\ConfigsApplyFixture $configFixture */
88
+ $ configFixture = $ fixtureModel
89
+ ->getFixtureByName (\Magento \Setup \Fixtures \ConfigsApplyFixture::class);
90
+ $ configFixture && $ this ->executeFixture ($ configFixture , $ output );
91
+
86
92
/** @var $config \Magento\Indexer\Model\Config */
87
93
$ config = $ fixtureModel ->getObjectManager ()->get (\Magento \Indexer \Model \Config::class);
88
94
$ indexerListIds = $ config ->getIndexers ();
@@ -97,16 +103,16 @@ protected function execute(InputInterface $input, OutputInterface $output)
97
103
}
98
104
99
105
foreach ($ fixtureModel ->getFixtures () as $ fixture ) {
100
- $ output ->write ('<info> ' . $ fixture ->getActionTitle () . '... </info> ' );
101
- $ startTime = microtime (true );
102
- $ fixture ->execute ($ output );
103
- $ endTime = microtime (true );
104
- $ resultTime = $ endTime - $ startTime ;
105
- $ output ->writeln ('<info> done in ' . gmdate ('H:i:s ' , $ resultTime ) . '</info> ' );
106
+ $ this ->executeFixture ($ fixture , $ output );
106
107
}
107
108
108
109
$ this ->clearChangelog ();
109
110
111
+ /** @var \Magento\Setup\Fixtures\IndexersStatesApplyFixture $indexerFixture */
112
+ $ indexerFixture = $ fixtureModel
113
+ ->getFixtureByName (\Magento \Setup \Fixtures \IndexersStatesApplyFixture::class);
114
+ $ indexerFixture && $ this ->executeFixture ($ indexerFixture , $ output );
115
+
110
116
foreach ($ indexerListIds as $ indexerId ) {
111
117
/** @var $indexer \Magento\Indexer\Model\Indexer */
112
118
$ indexer = $ indexerRegistry ->get ($ indexerId ['indexer_id ' ]);
@@ -148,4 +154,14 @@ private function clearChangelog()
148
154
}
149
155
}
150
156
}
157
+
158
+ private function executeFixture (\Magento \Setup \Fixtures \Fixture $ fixture , OutputInterface $ output )
159
+ {
160
+ $ output ->write ('<info> ' . $ fixture ->getActionTitle () . '... </info> ' );
161
+ $ startTime = microtime (true );
162
+ $ fixture ->execute ($ output );
163
+ $ endTime = microtime (true );
164
+ $ resultTime = $ endTime - $ startTime ;
165
+ $ output ->writeln ('<info> done in ' . gmdate ('H:i:s ' , $ resultTime ) . '</info> ' );
166
+ }
151
167
}
0 commit comments