/** * @expectedException RuntimeException */ public function testAddingInvestmentThrowsAnExeptionWhenMaxAmountExceeded() { $tranche = new Tranche(); $tranche->setMaxAmount(1000); $investment = new Investment(); $investment->setInvestor(new Investor()); $investment->setAmount(1500); $tranche->addInvestment($investment); }