public function rebalancingTrigger(Account $account) { $accountStatus = $account->getStatus(); if ($accountStatus === Account::STATUS_INIT_REBALANCE) { $this->logger->logInfo("Init rebalance for account: {$account->getId()}."); $this->liquidateAccountIfNeed($account); } elseif ($accountStatus === Account::STATUS_INIT_REBALANCE_COMPLETE || $accountStatus === Account::STATUS_REBALANCED || $accountStatus === Account::STATUS_ANALYZED) { $this->checkCashNeeds($account); } }
public function testSetStatus() { $this->account->setStatus(Account::STATUS_REBALANCED); $this->assertEquals(Account::STATUS_REBALANCED, $this->account->getStatus()); }