public function testGetGroup() { $number = '12345'; $site = $this->getMock('JLM\\ModelBundle\\Entity\\Site'); $site->expects($this->once())->method('getGroupNumber')->will($this->returnValue($number)); $door = $this->getMock('JLM\\ModelBundle\\Entity\\Door'); $door->expects($this->once())->method('getSite')->will($this->returnValue($site)); $contract = $this->getMock('JLM\\ContractBundle\\Model\\ContractInterface'); $contract->expects($this->once())->method('getDoor')->will($this->returnValue($door)); $this->entity->addContract($contract); $this->assertSame($number, $this->entity->getGroup()); }