@@ -50,6 +50,13 @@ class MetadataGenUtil
5050 */
5151 private $ inputString ;
5252
53+ /**
54+ * The relative filepath for the *meta.xml file to be generated.
55+ *
56+ * @var string
57+ */
58+ private $ filepath ;
59+
5360 /**
5461 * MetadataGenUtil constructor.
5562 *
@@ -64,6 +71,8 @@ public function __construct($operationName, $operationDataType, $operationUrl, $
6471 $ this ->operationDataType = $ operationDataType ;
6572 $ this ->operationUrl = $ operationUrl ;
6673 $ this ->inputString = $ inputString ;
74+
75+ $ this ->filepath = self ::OUTPUT_DIR . DIRECTORY_SEPARATOR . $ this ->operationDataType . "-meta.xml " ;
6776 }
6877
6978 /**
@@ -83,7 +92,7 @@ public function generateMetadataFile()
8392 $ output = $ this ->mustache_engine ->render ('operation ' , $ data );
8493 $ this ->cleanAndCreateOutputDir ();
8594 file_put_contents (
86- self :: OUTPUT_DIR . DIRECTORY_SEPARATOR . $ this ->operationDataType . " -meta.xml " ,
95+ $ this ->filepath ,
8796 $ output
8897 );
8998 }
@@ -153,16 +162,18 @@ private function convertResultToEntry($results, $defaultDataType)
153162 }
154163
155164 /**
156- * Function which cleans and creates the _output dir.
165+ * Function which cleans any previously created fileand creates the _output dir.
157166 *
158167 * @return void
159168 */
160169 private function cleanAndCreateOutputDir ()
161170 {
162- if (file_exists (self ::OUTPUT_DIR )) {
163- \ Magento \ FunctionalTestingFramework \ Util \ Filesystem \DirSetupUtil:: rmdirRecursive (self ::OUTPUT_DIR );
171+ if (! file_exists (self ::OUTPUT_DIR )) {
172+ mkdir (self ::OUTPUT_DIR );
164173 }
165174
166- mkdir (self ::OUTPUT_DIR );
175+ if (file_exists ($ this ->filepath )) {
176+ unlink ($ this ->filepath );
177+ }
167178 }
168179}
0 commit comments