88use Magento \Deploy \Console \DeployStaticOptions ;
99use Magento \Framework \App \DeploymentConfig \FileReader ;
1010use Magento \Framework \App \DeploymentConfig \Writer ;
11+ use Magento \Framework \App \DeploymentConfig \Writer \PhpFormatter ;
1112use Magento \Framework \App \Filesystem \DirectoryList ;
1213use Magento \Framework \Config \File \ConfigFilePool ;
1314use Magento \Framework \Console \Cli ;
@@ -70,6 +71,11 @@ class DeployStaticContentCommandTest extends \PHPUnit\Framework\TestCase
7071 */
7172 private $ storeManager ;
7273
74+ /**
75+ * @var PhpFormatter
76+ */
77+ private $ phpFormatter ;
78+
7379 /**
7480 * @inheritdoc
7581 */
@@ -81,7 +87,7 @@ protected function setUp(): void
8187 $ this ->filesystem = $ this ->objectManager ->get (Filesystem::class);
8288 $ this ->configFilePool = $ this ->objectManager ->get (ConfigFilePool::class);
8389 $ this ->storeManager = $ this ->objectManager ->get (StoreManagerInterface::class);
84-
90+ $ this -> phpFormatter = $ this -> objectManager -> get (PhpFormatter::class);
8591 $ this ->config = $ this ->loadConfig ();
8692 $ this ->envConfig = $ this ->loadEnvConfig ();
8793
@@ -129,10 +135,10 @@ public function testDeployStaticWithoutDbConnection()
129135 );
130136 $ this ->writer ->saveConfig ([ConfigFilePool::APP_CONFIG => $ newData ], true );
131137
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
133139 $ this ->filesystem ->getDirectoryWrite (DirectoryList::CONFIG )->writeFile (
134140 $ this ->configFilePool ->getPath (ConfigFilePool::APP_ENV ),
135- " <?php \n return []; \n"
141+ $ this -> phpFormatter -> format ([ ' remote_storage ' => $ this -> envConfig [ ' remote_storage ' ]])
136142 );
137143 $ this ->storeManager ->reinitStores ();
138144
0 commit comments