public function testForBock() { $Strategy = new Bock(); $this->object->setStrategy($Strategy); $this->assertEquals($Strategy->inSeconds(5), $this->object->inSeconds(5)); $this->assertEquals($Strategy->inSeconds(10), $this->object->inSeconds(10)); $this->assertEquals($Strategy->inSeconds(21.1), $this->object->inSeconds(21.1)); $this->assertEquals($Strategy->inSeconds(42.2), $this->object->inSeconds(42.2)); }
/** * Prepare calculations */ protected function prepareForPrognosis() { switch ($this->Configuration()->value('model')) { case 'cpp': $this->PrognosisStrategy = new Prognosis\Bock(); break; case 'steffny': $this->PrognosisStrategy = new Prognosis\Steffny(); break; case 'cameron': $this->PrognosisStrategy = new Prognosis\Cameron(); break; case 'jd': default: $this->PrognosisStrategy = new Prognosis\Daniels(); break; } $this->PrognosisStrategy->setupFromDatabase(); if ($this->Configuration()->value('model') == 'jd' && !$this->Configuration()->value('use_be')) { $this->PrognosisStrategy->setBasicEnduranceForAdjustment(INFINITY); } $this->Prognosis = new Prognosis\Prognosis(); $this->Prognosis->setStrategy($this->PrognosisStrategy); }