/** * * @param RainLab\User\Models\User $user $user * @param string $notificationName * @param array $channel * @return boolean|Ambigous <boolean, void> */ public function sendNotification(&$user, $notificationName, array $channel = null) { // Check if the user is part of the group or the owner. if (!$this->inGroup($user)) { if ($this->owner->getKey() != $user->getKey()) { return false; } } $group = $this; $fromUser = $this->owner; \Postman::send($notificationName, function ($notification) use($user, $fromUser, $group) { $notification->to($user, $user->name); $notification->from($fromUser); $notification->subject('Groups'); $notification->attachObject($group); }, $channel); return false; }
/** * Test for the `send` method. * * @return void * @access public */ public function testSend() { // Postman will throw exceptions if we send it the wrong arg. $this->expectException(); $this->_object->send(false); }