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
@@ -127,13 +133,12 @@ public function testDeployStaticWithoutDbConnection()
127133 $ this ->config ,
128134 require __DIR__ . '/_files/config/dump_config.php '
129135 );
130- $ newData ['remote_storage ' ] = $ this ->envConfig ['remote_storage ' ];
131136 $ this ->writer ->saveConfig ([ConfigFilePool::APP_CONFIG => $ newData ], true );
132137
133- // remove application environment config for emulate work without db
138+ //remove db details from application environment config to emulate work without db & set remote storage details
134139 $ this ->filesystem ->getDirectoryWrite (DirectoryList::CONFIG )->writeFile (
135140 $ this ->configFilePool ->getPath (ConfigFilePool::APP_ENV ),
136- " <?php \n return []; \n"
141+ $ this -> phpFormatter -> format ([ ' remote_storage ' => $ this -> envConfig [ ' remote_storage ' ]])
137142 );
138143 $ this ->storeManager ->reinitStores ();
139144
0 commit comments