/**
  * Deletes previously created Resources.
  */
 private static function deleteResources()
 {
     if (self::$recordsInitialized !== false) {
         foreach (self::$recordsInitialized as $i) {
             self::$DI['record_' . $i]->delete();
         }
         self::$recordsInitialized = [];
     }
     $duration = PhraseanetPHPUnitListener::getDurationByTest();
     $tests = [];
     foreach ($duration as $name => $data) {
         $tests[$name . '(total : ' . $data['time'] . ' and ' . $data['executions'] . ' executions)'] = $data['time'] / $data['executions'];
     }
     asort($tests);
     $csvData = PhraseanetPHPUnitListener::getCsv();
     if (count($csvData) > 0) {
         foreach ($csvData as $data) {
             file_put_contents(__DIR__ . '/../../report.csv', "\"" . implode('","', array_map(function ($value) {
                 return str_replace('"', '""', $value);
             }, $data)) . "\"\n", FILE_APPEND);
         }
     }
     PhraseanetPHPUnitListener::resetDuration();
     return;
 }
 /**
  * Deletes previously created Resources.
  */
 private static function deleteResources()
 {
     if (!empty(self::$recordsInitialized)) {
         foreach (self::$recordsInitialized as $i) {
             self::$DI['record_' . $i]->delete();
         }
         self::$recordsInitialized = [];
     }
     // Clear fixtures
     self::$fixtureIds = [];
 }