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
@@ -127,13 +133,12 @@ public function testDeployStaticWithoutDbConnection()
127
133
$ this ->config ,
128
134
require __DIR__ . '/_files/config/dump_config.php '
129
135
);
130
- $ newData ['remote_storage ' ] = $ this ->envConfig ['remote_storage ' ];
131
136
$ this ->writer ->saveConfig ([ConfigFilePool::APP_CONFIG => $ newData ], true );
132
137
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
134
139
$ this ->filesystem ->getDirectoryWrite (DirectoryList::CONFIG )->writeFile (
135
140
$ this ->configFilePool ->getPath (ConfigFilePool::APP_ENV ),
136
- " <?php \n return []; \n"
141
+ $ this -> phpFormatter -> format ([ ' remote_storage ' => $ this -> envConfig [ ' remote_storage ' ]])
137
142
);
138
143
$ this ->storeManager ->reinitStores ();
139
144
0 commit comments