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


PHP Fixture::canImagesBeIncludedInScheduledReports方法代碼示例

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


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

示例1: getApiForTestingScheduledReports

 /**
  * Return 4 Api Urls for testing scheduled reports :
  * - one in HTML format with all available reports
  * - one in PDF format with all available reports
  * - two in SMS (one for each available report: MultiSites.getOne & MultiSites.getAll)
  *
  * @param string $dateTime eg '2010-01-01 12:34:56'
  * @param string $period eg 'day', 'week', 'month', 'year'
  * @return array
  */
 protected static function getApiForTestingScheduledReports($dateTime, $period)
 {
     $apiCalls = array();
     // HTML Scheduled Report
     array_push($apiCalls, array('ScheduledReports.generateReport', array('testSuffix' => '_scheduled_report_in_html_tables_only', 'date' => $dateTime, 'periods' => array($period), 'format' => 'original', 'fileExtension' => 'html', 'otherRequestParameters' => array('idReport' => 1, 'reportFormat' => ReportRenderer::HTML_FORMAT, 'outputType' => \Piwik\Plugins\ScheduledReports\API::OUTPUT_RETURN))));
     // CSV Scheduled Report
     array_push($apiCalls, array('ScheduledReports.generateReport', array('testSuffix' => '_scheduled_report_in_csv', 'date' => $dateTime, 'periods' => array($period), 'format' => 'original', 'fileExtension' => 'csv', 'otherRequestParameters' => array('idReport' => 1, 'reportFormat' => ReportRenderer::CSV_FORMAT, 'outputType' => \Piwik\Plugins\ScheduledReports\API::OUTPUT_RETURN))));
     if (Fixture::canImagesBeIncludedInScheduledReports()) {
         // PDF Scheduled Report
         // tests/PHPUnit/System/processed/test_ecommerceOrderWithItems_scheduled_report_in_pdf_tables_only__ScheduledReports.generateReport_week.original.pdf
         array_push($apiCalls, array('ScheduledReports.generateReport', array('testSuffix' => '_scheduled_report_in_pdf_tables_only', 'date' => $dateTime, 'periods' => array($period), 'format' => 'original', 'fileExtension' => 'pdf', 'otherRequestParameters' => array('idReport' => 1, 'reportFormat' => ReportRenderer::PDF_FORMAT, 'outputType' => \Piwik\Plugins\ScheduledReports\API::OUTPUT_RETURN))));
     }
     // SMS Scheduled Report, one site
     array_push($apiCalls, array('ScheduledReports.generateReport', array('testSuffix' => '_scheduled_report_via_sms_one_site', 'date' => $dateTime, 'periods' => array($period), 'format' => 'original', 'fileExtension' => 'sms.txt', 'otherRequestParameters' => array('idReport' => 2, 'outputType' => \Piwik\Plugins\ScheduledReports\API::OUTPUT_RETURN))));
     // SMS Scheduled Report, all sites
     array_push($apiCalls, array('ScheduledReports.generateReport', array('testSuffix' => '_scheduled_report_via_sms_all_sites', 'date' => $dateTime, 'periods' => array($period), 'format' => 'original', 'fileExtension' => 'sms.txt', 'otherRequestParameters' => array('idReport' => 3, 'outputType' => \Piwik\Plugins\ScheduledReports\API::OUTPUT_RETURN))));
     if (Fixture::canImagesBeIncludedInScheduledReports()) {
         // HTML Scheduled Report with images
         array_push($apiCalls, array('ScheduledReports.generateReport', array('testSuffix' => '_scheduled_report_in_html_tables_and_graph', 'date' => $dateTime, 'periods' => array($period), 'format' => 'original', 'fileExtension' => 'html', 'otherRequestParameters' => array('idReport' => 4, 'reportFormat' => ReportRenderer::HTML_FORMAT, 'outputType' => \Piwik\Plugins\ScheduledReports\API::OUTPUT_RETURN))));
         // mail report with one row evolution based png graph
         array_push($apiCalls, array('ScheduledReports.generateReport', array('testSuffix' => '_scheduled_report_in_html_row_evolution_graph', 'date' => $dateTime, 'periods' => array($period), 'format' => 'original', 'fileExtension' => 'html', 'otherRequestParameters' => array('idReport' => 5, 'outputType' => \Piwik\Plugins\ScheduledReports\API::OUTPUT_RETURN))));
     }
     return $apiCalls;
 }
開發者ID:mgou-net,項目名稱:piwik,代碼行數:34,代碼來源:SystemTestCase.php


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