Skip to content

Commit

Permalink
Trigger double encoding error in #7987 by adding scheduled reports th…
Browse files Browse the repository at this point in the history
…rough API/Request in Fixture.php.
  • Loading branch information
diosmosis committed Jun 2, 2015
1 parent 0597f7f commit b321881
Showing 1 changed file with 34 additions and 30 deletions.
64 changes: 34 additions & 30 deletions tests/PHPUnit/Framework/Fixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
namespace Piwik\Tests\Framework;

use Piwik\Access;
use Piwik\API\Request;
use Piwik\Application\Environment;
use Piwik\Archive;
use Piwik\Cache\Backend\File;
Expand Down Expand Up @@ -636,41 +637,44 @@ public static function setUpScheduledReports($idSite)
}

//@review should we also test evolution graphs?
// add scheduled reports, but add via Request::processRequest to simulate normal user actions

// set-up mail report
APIScheduledReports::getInstance()->addReport(
$idSite,
'Mail Test report',
'day', // overridden in getApiForTestingScheduledReports()
0,
ScheduledReports::EMAIL_TYPE,
ReportRenderer::HTML_FORMAT, // overridden in getApiForTestingScheduledReports()
$availableReportIds,
array(ScheduledReports::DISPLAY_FORMAT_PARAMETER => ScheduledReports::DISPLAY_FORMAT_TABLES_ONLY)
);
Request::processRequest("ScheduledReports.addReport", array(
'idSite' => $idSite,
'description' => '"Mail Test report"',
'period' => 'day', // overridden in getApiForTestingScheduledReports()
'hour' => 0,
'reportType' => ScheduledReports::EMAIL_TYPE,
'reportFormat' => ReportRenderer::HTML_FORMAT, // overridden in getApiForTestingScheduledReports()
'reports' => $availableReportIds,
'parameters' => array(ScheduledReports::DISPLAY_FORMAT_PARAMETER => ScheduledReports::DISPLAY_FORMAT_TABLES_ONLY)
));

// set-up sms report for one website
APIScheduledReports::getInstance()->addReport(
$idSite,
'SMS Test report, one website',
'day', // overridden in getApiForTestingScheduledReports()
0,
MobileMessaging::MOBILE_TYPE,
MobileMessaging::SMS_FORMAT,
array("MultiSites_getOne"),
array("phoneNumbers" => array())
);
Request::processRequest("ScheduledReports.addReport", array(
'idSite' => $idSite,
'description' => '"SMS Test report, one website"',
'period' => 'day', // overridden in getApiForTestingScheduledReports()
'hour' => 0,
'reportType' => MobileMessaging::MOBILE_TYPE,
'reportFormat' => MobileMessaging::SMS_FORMAT,
'reports' => array("MultiSites_getOne"),
'parameters' => array("phoneNumbers" => array())
));

// set-up sms report for all websites
APIScheduledReports::getInstance()->addReport(
$idSite,
'SMS Test report, all websites',
'day', // overridden in getApiForTestingScheduledReports()
0,
MobileMessaging::MOBILE_TYPE,
MobileMessaging::SMS_FORMAT,
array("MultiSites_getAll"),
array("phoneNumbers" => array())
);
Request::processRequest("ScheduledReports.addReport", array(
'idSite' => $idSite,
'description' => '"SMS Test report, all websites"',
'period' => 'day', // overridden in getApiForTestingScheduledReports()
'hour' => 0,
'reportType' => MobileMessaging::MOBILE_TYPE,
'reportFormat' => MobileMessaging::SMS_FORMAT,
'reports' => array("MultiSites_getAll"),
'parameters' => array("phoneNumbers" => array())
));

if (self::canImagesBeIncludedInScheduledReports()) {
// set-up mail report with images
Expand Down

0 comments on commit b321881

Please sign in to comment.