public function testLeadsInteraction() { $result = $this->entity->getLeads(); $this->assertInstanceOf('Doctrine\\Common\\Collections\\ArrayCollection', $result); $this->assertCount(0, $result); $lead = $this->getMock('OroCRM\\Bundle\\SalesBundle\\Entity\\Lead'); $this->entity->addLead($lead); $this->assertCount(1, $this->entity->getLeads()); $this->assertTrue($this->entity->getLeads()->contains($lead)); $this->entity->removeLead($lead); $result = $this->entity->getLeads(); $this->assertCount(0, $result); $newCollection = new ArrayCollection(); $this->entity->setLeads($newCollection); $this->assertNotSame($result, $this->entity->getLeads()); $this->assertSame($newCollection, $this->entity->getLeads()); }