10
10
use Magento \Framework \App \ResourceConnection ;
11
11
use Magento \Framework \Setup \Mvc \MvcApplication ;
12
12
use Magento \Framework \Setup \Mvc \ServiceManagerFactory ;
13
- use Magento \Framework \Shell ;
14
- use Magento \Framework \Shell \CommandRenderer ;
13
+
15
14
use Magento \TestFramework \Deploy \CliCommand ;
16
15
use Magento \TestFramework \Deploy \TestModuleManager ;
17
16
use Magento \TestFramework \Helper \Bootstrap ;
@@ -37,18 +36,15 @@ class SetupInstallMvcTest extends SetupTestCase
37
36
*/
38
37
private $ resourceConnection ;
39
38
40
- /**
41
- * @var Shell
42
- */
43
- private $ shell ;
39
+
44
40
45
41
protected function setUp (): void
46
42
{
47
43
$ objectManager = Bootstrap::getObjectManager ();
48
44
$ this ->moduleManager = $ objectManager ->get (TestModuleManager::class);
49
45
$ this ->cliCommand = $ objectManager ->get (CliCommand::class);
50
46
$ this ->resourceConnection = $ objectManager ->get (ResourceConnection::class);
51
- $ this -> shell = new Shell ( new CommandRenderer ());
47
+
52
48
}
53
49
54
50
/**
@@ -283,12 +279,6 @@ public function testSetupInstallWithDataPatchesAndCustomMvc()
283
279
'patch_list table should exist after installation with data patches '
284
280
);
285
281
286
- // Check for patch records (may or may not exist depending on module)
287
- $ select = $ connection ->select ()
288
- ->from ($ patchListTable )
289
- ->where ('patch_name LIKE ? ' , '%TestSetupDeclarationModule1% ' );
290
- $ patchRecords = $ connection ->fetchAll ($ select );
291
-
292
282
// Data patches are optional, so we just verify the table exists
293
283
$ this ->assertTrue (
294
284
$ connection ->isTableExists ($ patchListTable ),
@@ -1032,7 +1022,15 @@ private function executeDiCompileCommand($params = [])
1032
1022
}
1033
1023
1034
1024
try {
1035
- return $ this ->shell ->execute ($ diCompileCommand );
1025
+ $ output = [];
1026
+ $ returnCode = 0 ;
1027
+ exec ($ diCompileCommand . ' 2>&1 ' , $ output , $ returnCode );
1028
+
1029
+ if ($ returnCode !== 0 ) {
1030
+ throw new \Exception (implode ("\n" , $ output ));
1031
+ }
1032
+
1033
+ return implode ("\n" , $ output );
1036
1034
} catch (\Exception $ e ) {
1037
1035
// Check if this is the "modules are not enabled" error
1038
1036
$ errorMessage = $ e ->getMessage ();
0 commit comments