Fix tests
This commit is contained in:
@@ -37,7 +37,7 @@ final class IncidentWasReportedEvent implements IncidentEventInterface
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct(Incident $incident, $notify)
|
public function __construct(Incident $incident, $notify = false)
|
||||||
{
|
{
|
||||||
$this->incident = $incident;
|
$this->incident = $incident;
|
||||||
$this->notify = $notify;
|
$this->notify = $notify;
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||||
|
|
||||||
|
use CachetHQ\Cachet\Models\Invite;
|
||||||
use CachetHQ\Cachet\Models\User;
|
use CachetHQ\Cachet\Models\User;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class ComponentStatusWasUpdatedEventTest extends AbstractComponentEventTestCase
|
|||||||
$this->app['events']->fire(new ComponentStatusWasUpdatedEvent($component, 1, 2));
|
$this->app['events']->fire(new ComponentStatusWasUpdatedEvent($component, 1, 2));
|
||||||
|
|
||||||
$this->seeMessageFor($subscriber->email);
|
$this->seeMessageFor($subscriber->email);
|
||||||
$this->seeMessageWithSubject(trans('cachet.subscriber.email.component.subject'));
|
$this->seeMessageWithSubject(trans('notifications.component.status_update.subject'));
|
||||||
|
|
||||||
$message = $this->getMailer()->lastMessage();
|
$message = $this->getMailer()->lastMessage();
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,10 @@ class IncidentWasReportedEventTest extends AbstractIncidentEventTestCase
|
|||||||
|
|
||||||
protected function getObjectAndParams()
|
protected function getObjectAndParams()
|
||||||
{
|
{
|
||||||
$params = ['incident' => new Incident()];
|
$params = [
|
||||||
|
'incident' => new Incident(),
|
||||||
|
'notify' => true,
|
||||||
|
];
|
||||||
$object = new IncidentWasReportedEvent($params['incident']);
|
$object = new IncidentWasReportedEvent($params['incident']);
|
||||||
|
|
||||||
return compact('params', 'object');
|
return compact('params', 'object');
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Cachet.
|
||||||
|
*
|
||||||
|
* (c) Alt Three Services Limited
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace CachetHQ\Tests\Cachet\Bus\Events\User;
|
||||||
|
|
||||||
|
use CachetHQ\Cachet\Bus\Events\User\UserAcceptedInviteEvent;
|
||||||
|
use CachetHQ\Cachet\Models\Invite;
|
||||||
|
use CachetHQ\Cachet\Models\User;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is the user accepted invite event test class.
|
||||||
|
*
|
||||||
|
* @author James Brooks <james@alt-three.com>
|
||||||
|
*/
|
||||||
|
class UserAcceptedInviteEventTest extends AbstractUserEventTestCase
|
||||||
|
{
|
||||||
|
protected function objectHasHandlers()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getObjectAndParams()
|
||||||
|
{
|
||||||
|
$params = [
|
||||||
|
'user' => new User(),
|
||||||
|
'invite' => new Invite(),
|
||||||
|
];
|
||||||
|
$object = new UserAcceptedInviteEvent($params['user'], $params['invite']);
|
||||||
|
|
||||||
|
return compact('params', 'object');
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user