Fix tests

This commit is contained in:
James Brooks
2017-01-04 20:42:14 +00:00
parent 1b5ddc66dc
commit c20a66ed48
5 changed files with 47 additions and 3 deletions

View File

@@ -37,7 +37,7 @@ final class IncidentWasReportedEvent implements IncidentEventInterface
*
* @return void
*/
public function __construct(Incident $incident, $notify)
public function __construct(Incident $incident, $notify = false)
{
$this->incident = $incident;
$this->notify = $notify;

View File

@@ -11,6 +11,7 @@
namespace CachetHQ\Cachet\Bus\Events\User;
use CachetHQ\Cachet\Models\Invite;
use CachetHQ\Cachet\Models\User;
/**

View File

@@ -40,7 +40,7 @@ class ComponentStatusWasUpdatedEventTest extends AbstractComponentEventTestCase
$this->app['events']->fire(new ComponentStatusWasUpdatedEvent($component, 1, 2));
$this->seeMessageFor($subscriber->email);
$this->seeMessageWithSubject(trans('cachet.subscriber.email.component.subject'));
$this->seeMessageWithSubject(trans('notifications.component.status_update.subject'));
$message = $this->getMailer()->lastMessage();

View File

@@ -28,7 +28,10 @@ class IncidentWasReportedEventTest extends AbstractIncidentEventTestCase
protected function getObjectAndParams()
{
$params = ['incident' => new Incident()];
$params = [
'incident' => new Incident(),
'notify' => true,
];
$object = new IncidentWasReportedEvent($params['incident']);
return compact('params', 'object');

View File

@@ -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');
}
}