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);
 }
 /**
  * {@inheritdoc}
  */
 public function getRecipientEmails()
 {
     return $this->em->getRepository('Oro\\Bundle\\NotificationBundle\\Entity\\RecipientList')->getRecipientEmails($this->notification->getRecipientList(), $this->entity);
 }
 /**
  * {@inheritdoc}
  */
 public function getRecipientEmails()
 {
     $class = ClassUtils::getClass($this->entity);
     $ownerFieldName = $this->configProvider->hasConfig($class) ? $this->configProvider->getConfig($class)->get('owner_field_name') : null;
     return $this->em->getRepository('Oro\\Bundle\\NotificationBundle\\Entity\\RecipientList')->getRecipientEmails($this->notification->getRecipientList(), $this->entity, $ownerFieldName);
 }