Advertisement
Guest User

Untitled

a guest
Aug 15th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. public function setupContext()
  2. {
  3. $investor = $this->getContext()
  4. ->customer()
  5. ->investor($id = 1, \common\core\models\Investor::WORKFLOW_CASH, $withdrawalPolicy = 'balance');
  6.  
  7. $investor
  8. ->shopLoan($id = 1, $value = 6000.00, $hasRegistry = true)
  9. ->investorLoan($id = 1, $value = 2000)
  10. ->investorLoan($id = 2, $value = 3000, true);
  11.  
  12. $investor
  13. ->shopLoan($id = 2, $value = 3000.00, $hasRegistry = false)
  14. ->investorLoan($id = 3, $value = 1000)
  15. ->investorLoan($id = 4, $value = 2000, false, $dueDate = $investor->getDayContext()->date);
  16.  
  17. $investor
  18. ->shopLoan($id = 3, $value = 3000.00, $hasRegistry = false)
  19. ->investorLoan($id = 5, $value = 3000, $is_amortizable = true);
  20.  
  21. }
  22.  
  23. public function createActions()
  24. {
  25. $this
  26. // given
  27. ->depositInvestorLoan($id = 1, $body = 2000.0, $interest = 20)
  28. ->depositInvestorLoan($id = 2, $body = 3000, $interest = 30)
  29. ->depositInvestorLoan($id = 3, $body = 1000, $interest = 30)
  30. ->depositInvestorLoan($id = 4, $body = 2000, $interest = 15)
  31. ->depositInvestorLoan($id = 5, $body = 3000, $interest = 10)
  32. ->registerCustomerLoanRepayments($id = 1, $totalLoanBeforeRepayments = 12000, $adminRepayments = 300, $clientRepayment = 300)
  33. ->registerCustomerIncomeForInvestorPlatform($totalIncome = 2000.00, $perShopLoanIncomes = [1 => 200.00])
  34. // when
  35. ->performOnlyInvestorPlatformRepayments()
  36. // then
  37.  
  38. ->assertInvestorLoanDepositInterest($id = 1, $interest = 0.0)
  39. ->assertInvestorLoanDeposit($id = 1, $body = 1950)
  40. ->assertInvestorLoanDepositInterest($id = 2, 0.0)
  41. ->assertInvestorLoanDeposit($id = 2, $body = 2856.75)
  42. ->assertInvestorLoanDepositInterest($id = 3, 0.0)
  43. ->assertInvestorLoanDeposit($id = 3, $body = 975)
  44. ->assertInvestorLoanDepositInterest($id = 4, 0.0)
  45. ->assertInvestorLoanDeposit($id = 4, $body = 0)//->assertInvestorLoanWithdrawalRequests($id=1, $body=4, $interest=2.34)
  46. ;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement