Exemplo n.º 1
0
 function testCalculateAverage(Statistic $statistic){
     $values = new ArrayObject(array(1,2,3,4,5,6, 6.33));
     assertTrue($statistic->average($values->getIterator()) == 3.90);
 }
Exemplo n.º 2
0
 /**
  * @test
  */
 public function getAverage()
 {
     $values = $this->listFilteredByOneSubgroup(true);
     $values = $this->getValuesFromData($values);
     $this->assertEquals(200, $this->statistic->average($values));
 }
 private function average($values)
 {
     $this->writeValue($this->statistic->average($values));
 }