public function testGetAmount() { $c1 = $this->getMock('JLM\\ContractBundle\\Model\\ContractInterface'); $c2 = $this->getMock('JLM\\ContractBundle\\Model\\ContractInterface'); $c1->expects($this->once())->method('getFee')->will($this->returnValue(100.0)); $c2->expects($this->once())->method('getFee')->will($this->returnValue(200.0)); $this->entity->addContract($c1); $this->entity->addContract($c2); $this->entity->setFrequence(2); $this->assertSame(150.0, $this->entity->getAmount()); }