See {@link http://developer.piwik.org/api-reference/Piwik/Plugin/Report} for more information.
Inheritance: extends Base
Example #1
0
 public function test_fetch_ShouldUseCorrectApiUrl()
 {
     PluginManager::getInstance()->loadPlugins(array('API', 'ExampleReport'));
     $proxyMock = $this->getMock('stdClass', array('call', '__construct'));
     $proxyMock->expects($this->once())->method('call')->with('\\Piwik\\Plugins\\ExampleReport\\API', 'getExampleReport', array('idSite' => 1, 'date' => '2012-01-02', 'format' => 'original', 'module' => 'API', 'method' => 'ExampleReport.getExampleReport'))->willReturn("result");
     Proxy::setSingletonInstance($proxyMock);
     $report = new GetExampleReport();
     $result = $report->fetch(array('idSite' => 1, 'date' => '2012-01-02'));
     $this->assertEquals("result", $result);
 }