當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PhraseanetTestCase::recordsInitialized方法代碼示例

本文整理匯總了PHP中PhraseanetTestCase::recordsInitialized方法的典型用法代碼示例。如果您正苦於以下問題:PHP PhraseanetTestCase::recordsInitialized方法的具體用法?PHP PhraseanetTestCase::recordsInitialized怎麽用?PHP PhraseanetTestCase::recordsInitialized使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PhraseanetTestCase的用法示例。


在下文中一共展示了PhraseanetTestCase::recordsInitialized方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: deleteResources

 /**
  * 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;
 }
開發者ID:romainneutron,項目名稱:Phraseanet,代碼行數:28,代碼來源:PhraseanetTestCase.php

示例2: deleteResources

 /**
  * 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 = [];
 }
開發者ID:luisbrito,項目名稱:Phraseanet,代碼行數:14,代碼來源:PhraseanetTestCase.php


注:本文中的PhraseanetTestCase::recordsInitialized方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。