File tree Expand file tree Collapse file tree 2 files changed +18
-15
lines changed
dev/tests/api-functional/testsuite/Magento/Downloadable/Api
lib/internal/Magento/Framework/App/DeploymentConfig Expand file tree Collapse file tree 2 files changed +18
-15
lines changed Original file line number Diff line number Diff line change @@ -36,8 +36,17 @@ class SampleRepositoryTest extends WebapiAbstract
3636 */
3737 protected $ deleteServiceInfo ;
3838
39+ /**
40+ * @var DomainManagerInterface
41+ */
42+ private $ domainManager ;
43+
3944 protected function setUp (): void
4045 {
46+ $ objectManager = Bootstrap::getObjectManager ();
47+ $ this ->domainManager = $ objectManager ->get (DomainManagerInterface::class);
48+ $ this ->domainManager ->addDomains (['example.com ' ]);
49+
4150 $ this ->createServiceInfo = [
4251 'rest ' => [
4352 'resourcePath ' => '/V1/products/downloadable-product/downloadable-links/samples ' ,
@@ -75,6 +84,15 @@ protected function setUp(): void
7584 $ this ->testImagePath = __DIR__ . str_replace ('/ ' , DIRECTORY_SEPARATOR , '/_files/test_image.jpg ' );
7685 }
7786
87+ /**
88+ * Remove example domain from whitelist and call parent restore configuration
89+ */
90+ protected function tearDown (): void
91+ {
92+ parent ::tearDown ();
93+ $ this ->domainManager ->removeDomains (['example.com ' ]);
94+ }
95+
7896 /**
7997 * Retrieve product that was updated by test
8098 *
Original file line number Diff line number Diff line change @@ -100,7 +100,6 @@ public function load($fileKey = null)
100100 if ($ fileKey ) {
101101 $ filePath = $ path . '/ ' . $ this ->configFilePool ->getPath ($ fileKey );
102102 if ($ fileDriver ->isExists ($ filePath )) {
103- $ this ->refreshCache ($ filePath );
104103 $ result = include $ filePath ;
105104 if (!is_array ($ result )) {
106105 throw new RuntimeException (new Phrase ("Invalid configuration file: '%1' " , [$ filePath ]));
@@ -111,7 +110,6 @@ public function load($fileKey = null)
111110 foreach ($ configFiles as $ file ) {
112111 $ configFile = $ path . '/ ' . $ file ;
113112 if ($ fileDriver ->isExists ($ configFile )) {
114- $ this ->refreshCache ($ configFile );
115113 $ fileData = include $ configFile ;
116114 if (!is_array ($ fileData )) {
117115 throw new RuntimeException (new Phrase ("Invalid configuration file: '%1' " , [$ configFile ]));
@@ -126,17 +124,4 @@ public function load($fileKey = null)
126124 }
127125 return $ result ?: [];
128126 }
129-
130- /**
131- * Invalidate cache
132- *
133- * @param string $filePath
134- */
135- private function refreshCache (string $ filePath ): void
136- {
137- if (function_exists ('opcache_invalidate ' )
138- && filter_var (ini_get ('opcache.enable ' ), FILTER_VALIDATE_BOOLEAN )) {
139- opcache_invalidate ($ filePath );
140- }
141- }
142127}
You can’t perform that action at this time.
0 commit comments