Example #1
0
 /**
  * @covers Aclivo\Kpi\View::setTotalizer
  * @covers Aclivo\Kpi\View::getTotal
  */
 public function testSetTotalizer()
 {
     $actual = 0;
     $points = array();
     for ($x = 1; $x <= 5; $x++) {
         $dp = new DataPoint();
         $dp->setActual($x * 100);
         $actual += $x * 100;
         $dp->setTarget($x * 100);
         $dp->setMargin(0.1);
         $points[] = $dp;
     }
     $view = new View();
     $view->setDataPoints($points);
     $totalizer = new SumTotalizer();
     $view->setTotalizer($totalizer);
     $this->assertEquals($actual, $view->getTotal()->getActual());
 }