-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes #5951 throw an exception in getRowEvolution if a report is requ…
…est that does not have a dimension
- Loading branch information
Showing
3 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
/** | ||
* Piwik - free/libre analytics platform | ||
* | ||
* @link http://piwik.org | ||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later | ||
*/ | ||
|
||
namespace Piwik\Plugins\API\tests; | ||
use Piwik\Plugins\API\RowEvolution; | ||
use Piwik\Tests\Fixture; | ||
|
||
/** | ||
* @group API | ||
* @group RowEvolutionTest | ||
* @group Database | ||
*/ | ||
class RowEvolutionTest extends \DatabaseTestCase | ||
{ | ||
|
||
public function setUp() | ||
{ | ||
parent::setUp(); | ||
Fixture::createWebsite('2014-01-01 00:00:00'); | ||
} | ||
|
||
/** | ||
* @expectedException \Exception | ||
* @expectedExceptionMessage Reports like VisitsSummary.get which do not have a dimension are not supported by row evolution | ||
*/ | ||
public function test_getRowEvolution_shouldTriggerAnException_IfReportHasNoDimension() | ||
{ | ||
$rowEvolution = new RowEvolution(); | ||
$rowEvolution->getRowEvolution(1, 'day', 'last7', 'VisitsSummary', 'get'); | ||
} | ||
|
||
public function test_getRowEvolution_shouldNotTriggerAnException_IfReportHasADimension() | ||
{ | ||
$rowEvolution = new RowEvolution(); | ||
$table = $rowEvolution->getRowEvolution(1, 'day', 'last7', 'Actions', 'getPageUrls'); | ||
$this->assertNotEmpty($table); | ||
} | ||
|
||
} |