@tassoman wrote:
My Plugin is essentially a PHPunit tests container, it should catch metrics from a remote Piwik installation, then from local installation.
My problem is submitting a local request to Piwik\API, I'm simply getting Exception: General_ExceptionInvalidRendererFormat
This is the code:
private $queryURL;
private $local;
private $remoteHost = 'http://demo.piwik.org/index.php?';
private $queryParams = array(
'module=API',
'method=API.get',
'period=day',
'date=yesterday',
'format=JSON',
);`public function setUp()
{
// set up here if needed
$this->queryURL = implode('&', $this->queryParams);$url = new Url(); $this->local = $url->getCurrentUrl();
}`
public function testCompare()
{
$http = new Http();
$json = $http->fetchRemoteFile($this->remoteHost . $this->queryURL . '&idSite=7');
$remote_data = json_decode($json, true);
$request = new Request($this->queryURL . '&idSite=1');
$response = $request->process();
$local_data = $response->getSerialized();
$this->assertEquals($remote_data, $local_data);
}
Posts: 2
Participants: 1