File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -192,7 +192,8 @@ protected function buildFlatXMLDataSet(array $dataSet): string
192192 throw new RuntimeException ('Failed to save XML from DOM. ' );
193193 }
194194
195- // Replace the tags with 4 spaces
195+ // Manually indent child elements with 4 spaces for consistent fixture formatting.
196+ // DOM's formatOutput doesn't provide control over indentation depth.
196197 return str_replace (
197198 [
198199 '<tree ' , '<multiple_tree ' ],
@@ -224,6 +225,7 @@ protected function createDatabase(): void
224225 try {
225226 $ this ->runMigrate ('down ' , ['all ' ]);
226227 } catch (RuntimeException ) {
228+ // Ignore errors when rolling back migrations on a potentially fresh database
227229 }
228230
229231 foreach ($ dropTables as $ table ) {
@@ -303,7 +305,7 @@ protected function generateFixtureTree(): void
303305 $ command = $ this ->getDb ()->createCommand ();
304306
305307 // Load XML fixture data into database tables
306- $ xml = new SimpleXMLElement ( "{ $ this ->fixtureDirectory } / test.xml" , 0 , true );
308+ $ xml = $ this ->loadFixtureXML ( ' test.xml ' );
307309
308310 $ children = $ xml ->children () ?? [];
309311
You can’t perform that action at this time.
0 commit comments