Exemple #1
0
 public static function main()
 {
     $loanSystem = LoanSystemBuilder::build();
     foreach (self::getCustomers() as $customerDefinition) {
         /** @var BankCustomer $customer */
         $customer = $customerDefinition[0];
         $loanAmount = $customerDefinition[1];
         $loanRequest = new LoanApplicationRequest($customer, $loanAmount);
         $loanResponse = $customer->applyForLoan($loanAmount, $loanSystem);
         echo self::generateStory($loanRequest, $loanResponse);
     }
 }
 public function testBuild()
 {
     $loanSystem = LoanSystemBuilder::build();
     $this->assertNotNull($loanSystem);
     $this->assertInstanceOf('\\PetrePatrasc\\ChainOfResponsibility\\Bank\\LoanSystem', $loanSystem);
 }
 /**
  * @inheritDoc
  */
 protected function setUp()
 {
     parent::setUp();
     $this->loanSystem = LoanSystemBuilder::build();
 }