/** * Constructor * @param array $data */ public function __construct(array $data) { $this->Data = $data; $this->Activity = new Activity\Object($data); $this->Shape = $this->loadShape($data['time']); VDOT::setPrecision(2); VDOTCorrector::setGlobalFactor(Configuration::Data()->vdotFactor()); }
protected function setUp() { $this->PDO = new PDO('sqlite::memory:'); $this->PDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $this->PDO->exec('CREATE TABLE IF NOT EXISTS `' . PREFIX . 'training` ( `accountid` int(10), `sportid` int(10), `time` int(10), `s` int(10), `use_vdot` tinyint(1), `vdot` decimal(5,2), `vdot_with_elevation` decimal(5,2) ); '); VDOTCorrector::setGlobalFactor(1.0); }
/** * Init constants */ private function defineConsts() { require_once FRONTEND_PATH . 'system/define.consts.php'; Configuration::loadAll(); \Runalyze\Calculation\JD\VDOTCorrector::setGlobalFactor(Configuration::Data()->vdotFactor()); require_once FRONTEND_PATH . 'class.Helper.php'; }
public function testGlobalFactor() { VDOTCorrector::setGlobalFactor(0.5); $Corrector = new VDOTCorrector(); $this->assertEquals(0.5, $Corrector->factor()); }