Exemple #1
0
 public function testOrderStatsReport()
 {
     $stats_report = StatsGen::genStatsReport();
     $duplicated_stats_report = clone $stats_report;
     $this->reports->orderStatsReport('time_start', $stats_report);
     $this->assertCount(count($stats_report->stats), $duplicated_stats_report->stats);
     $this->assertNotEquals($stats_report->stats, $duplicated_stats_report->stats);
 }
 public function testPurgeStatsOnRefresh()
 {
     $stats_report = StatsGen::genStatsReport();
     $stats_report2 = clone $stats_report;
     $stats_report2->refreshValues();
     $this->assertEquals($stats_report->clicks, $stats_report2->clicks);
     $this->assertEquals($stats_report->impressions, $stats_report2->impressions);
     $this->assertEquals($stats_report->cost, $stats_report2->cost);
     $this->assertEquals($stats_report->cpc, $stats_report2->cpc);
     $this->assertEquals($stats_report->ctr, $stats_report2->ctr);
 }
 public function testRefreshValues()
 {
     $stats_report = StatsGen::genStatsReport();
     $stats_report2 = clone $stats_report;
     $stats_report->refreshValues();
     $this->assertNotNull($stats_report->conversions);
     $this->assertNotNull($stats_report->conversion_rate);
     $this->assertNotNull($stats_report->cost_per_conversion);
     $this->assertNotNull($stats_report->conversions_many_per_click);
     $this->assertNotNull($stats_report->conversion_rate_many_per_click);
     $this->assertNotNull($stats_report->cost_per_conversion_many_per_click);
     $this->assertNotNull($stats_report->view_through_conversion);
     $this->assertNotNull($stats_report2->conversions);
     $this->assertNotNull($stats_report2->conversion_rate);
     $this->assertNotNull($stats_report2->cost_per_conversion);
     $this->assertNotNull($stats_report2->conversions_many_per_click);
     $this->assertNotNull($stats_report2->conversion_rate_many_per_click);
     $this->assertNotNull($stats_report2->cost_per_conversion_many_per_click);
     $this->assertNotNull($stats_report2->view_through_conversion);
     $this->assertEquals($stats_report->conversions, $stats_report2->conversions);
     $this->assertEquals($stats_report->conversion_rate, $stats_report2->conversion_rate);
     $this->assertEquals($stats_report->cost_per_conversion, $stats_report2->cost_per_conversion);
     $this->assertEquals($stats_report->conversions_many_per_click, $stats_report2->conversions_many_per_click);
     $this->assertEquals($stats_report->conversion_rate_many_per_click, $stats_report2->conversion_rate_many_per_click);
     $this->assertEquals($stats_report->cost_per_conversion_many_per_click, $stats_report2->cost_per_conversion_many_per_click);
     $this->assertEquals($stats_report->view_through_conversion, $stats_report2->view_through_conversion);
 }