Skip to content

Commit

Permalink
adds test to prove bandwidth is available in Live.getLastVisitsDetail…
Browse files Browse the repository at this point in the history
…s report
  • Loading branch information
sgiehl committed Jul 2, 2017
1 parent d61f835 commit a4fa16e
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/Integration/BandwidthTest.php
Expand Up @@ -14,6 +14,7 @@
use Piwik\Plugin;
use Piwik\Plugins\Bandwidth\API;
use Piwik\Plugins\Bandwidth\tests\Framework\TestCase\IntegrationTestCase;
use Piwik\Version;

/**
* Bandidth Class and Bandwidth Tracker test
Expand Down Expand Up @@ -107,6 +108,29 @@ public function test_shouldEnrichDownloads()
$this->assertBandwidthStats($row, $maxB = 3949, $minB = 1, $sumB = 4362, $avgB = 872);
}

public function test_shouldEnrichLiveActions()
{
if (!class_exists('\\Piwik\\Plugins\\Live\\VisitorDetailsAbstract')) {
$this->markTestSkipped('Extended Live reports not available in this Piwik version');
}

$this->trackPageviews(array(1, 10, null, 5, null, 3949, 399));

$params = array(
'idSite' => 1,
'period' => 'day',
'date' => $this->date
);

$result = Request::processRequest('Live.getLastVisitsDetails', $params);
$row = $result->getFirstRow();

$actions = $row->getColumn('actionDetails');
foreach ($actions as $action) {
$this->assertArrayHasKey('bandwidth', $action);
}
}

public function test_manyDifferentUrlsWithFolders_ShouldAggregateStats()
{
$tracker = $this->getTracker();
Expand Down

0 comments on commit a4fa16e

Please sign in to comment.