Example #1
0
 /**
  * @test
  */
 public function testCalculateDerivesVary()
 {
     $inputArray = $this->testInputForm->getSampleForm();
     $inputArray['zip'] = "72519";
     //AR
     $inputArray['marketPrice'] = "800000";
     $inputArray['loanAmount'] = "600000";
     //above confirming limit
     $inputArray['closingOption'] = LoanerConst::CLOSING_OPTION_BY_MIN_CREDIT;
     $inputArray['mincredit'] = -2000;
     $testLoanProperty = new LoanProperty($inputArray);
     $testLoanProperty->calculateDerives();
     //verify result
     $this->assertEquals($testLoanProperty->getState(), "AR");
     $this->assertEquals($testLoanProperty->confirmingUpperLimit, 417000);
     $this->assertEquals($testLoanProperty->isConfirming, 0);
     $this->assertEquals($testLoanProperty->mincredit, -2000);
     //pay 2000
     $this->assertEquals(count($testLoanProperty->loanAmountOptions), 2);
     //default npncc
     $this->assertEquals($testLoanProperty->margin, 0.5);
     //none confirming margin
     $this->assertContains("with minimum +credits/-payment", $testLoanProperty->getClosingOption());
     //none confirming margin
     $this->assertTrue($testLoanProperty->loanLimitCheck());
     //passed basic check
 }