public function setUp() { parent::setUp(); $apiKey = $this->settings['oanda']['apiKey']; $accountId = $this->settings['oanda']['accountId']; $type = $this->settings['oanda']['serverType']; $pairs = $this->settings['oanda']['pairs']; $this->oandaInfo = new Broker_Oanda($type, $apiKey, $accountId, $pairs); }
/** * require Args array $args = array( 'time' => time(), 'userid' => '', 'oanda' => array( 'accountId' => '', ), ); */ public function setUp() { parent::setUp(); $accountId = $this->args['oanda']['accountId']; $account = R::findOne('accounts', ' accountid = ?', [$accountId]); if (!empty($account)) { $apiKey = $account['apikey']; $type = $account['servertype']; $this->oandaInfo = new Broker_Oanda($type, $apiKey, $accountId); } else { throw new \Exception('Oanda AccountId not found'); } }