8
8
use Magento \Deploy \Console \DeployStaticOptions ;
9
9
use Magento \Framework \App \DeploymentConfig \FileReader ;
10
10
use Magento \Framework \App \DeploymentConfig \Writer ;
11
+ use Magento \Framework \App \DeploymentConfig \Writer \PhpFormatter ;
11
12
use Magento \Framework \App \Filesystem \DirectoryList ;
12
13
use Magento \Framework \Config \File \ConfigFilePool ;
13
14
use Magento \Framework \Console \Cli ;
@@ -70,6 +71,11 @@ class DeployStaticContentCommandTest extends \PHPUnit\Framework\TestCase
70
71
*/
71
72
private $ storeManager ;
72
73
74
+ /**
75
+ * @var PhpFormatter
76
+ */
77
+ private $ phpFormatter ;
78
+
73
79
/**
74
80
* @inheritdoc
75
81
*/
@@ -81,7 +87,7 @@ protected function setUp(): void
81
87
$ this ->filesystem = $ this ->objectManager ->get (Filesystem::class);
82
88
$ this ->configFilePool = $ this ->objectManager ->get (ConfigFilePool::class);
83
89
$ this ->storeManager = $ this ->objectManager ->get (StoreManagerInterface::class);
84
-
90
+ $ this -> phpFormatter = $ this -> objectManager -> get (PhpFormatter::class);
85
91
$ this ->config = $ this ->loadConfig ();
86
92
$ this ->envConfig = $ this ->loadEnvConfig ();
87
93
@@ -129,10 +135,10 @@ public function testDeployStaticWithoutDbConnection()
129
135
);
130
136
$ this ->writer ->saveConfig ([ConfigFilePool::APP_CONFIG => $ newData ], true );
131
137
132
- // remove application environment config for emulate work without db
138
+ // rewrite application environment config with only remote storage details to emulate work without db
133
139
$ this ->filesystem ->getDirectoryWrite (DirectoryList::CONFIG )->writeFile (
134
140
$ this ->configFilePool ->getPath (ConfigFilePool::APP_ENV ),
135
- " <?php \n return []; \n"
141
+ $ this -> phpFormatter -> format ([ ' remote_storage ' => $ this -> envConfig [ ' remote_storage ' ]])
136
142
);
137
143
$ this ->storeManager ->reinitStores ();
138
144
0 commit comments