public function testFindVSPForTradeData()
 {
     $riaRepo = new RiaRepository();
     $ria = $riaRepo->findOneBy(array('email' => '*****@*****.**'));
     $jobRepo = new JobRepository();
     $job = $jobRepo->findOneBy(array('user_id' => $ria->getId()));
     $accountRepo = new AccountRepository();
     $securityRepo = new SecurityRepository();
     $tradeData = new TradeData();
     $tradeData->setJobId($job->getId());
     $tradeData->setAccountId($accountRepo->findOneByAccountNumber('916985328')->getId());
     $tradeData->setSecurityId($securityRepo->findOneBySymbol('RWX')->getId());
     $vsps = $this->repository->findVSPForTradeData($tradeData);
     $vspsExpected = array(array('purchase' => 'VSP', 'purchase_date' => '02132013', 'quantity' => 36), array('purchase' => 'VSP', 'purchase_date' => '02162013', 'quantity' => 20));
     $this->assertEquals($vspsExpected, $vsps);
 }
Exemplo n.º 2
0
 public function testSetSecurityId()
 {
     $this->tradeData->setSecurityId(2000);
     $this->assertEquals(2000, $this->tradeData->getSecurityId());
 }