Esempio n. 1
0
 public function testGetGroupsRecipientsList()
 {
     $this->assertTrue($this->entity->getRecipientGroupsList()->isEmpty());
     $groupMock1 = $this->getMock('Oro\\Bundle\\UserBundle\\Entity\\Group');
     $groupMock2 = $this->getMock('Oro\\Bundle\\UserBundle\\Entity\\Group');
     $collection = new ArrayCollection(array($groupMock1, $groupMock2));
     $list = $this->getMock('Oro\\Bundle\\NotificationBundle\\Entity\\RecipientList');
     $list->expects($this->once())->method('getGroups')->will($this->returnValue($collection));
     $this->entity->setRecipientList($list);
     $actual = $this->entity->getRecipientGroupsList();
     $this->assertInstanceOf('Doctrine\\Common\\Collections\\ArrayCollection', $actual);
     $this->assertEquals($collection, $actual);
 }