Rename ComponentStatusWasUpdated
This commit is contained in:
@@ -16,21 +16,21 @@ use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the component status was updated event.
|
||||
* This is the component status was changed event.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class ComponentStatusWasUpdatedEvent implements ActionInterface, ComponentEventInterface
|
||||
final class ComponentStatusWasChangedEvent implements ActionInterface, ComponentEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who updated the component.
|
||||
* The user who changed the component.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The component that was updated.
|
||||
* The component that was changed.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Component
|
||||
*/
|
||||
@@ -84,7 +84,7 @@ final class ComponentStatusWasUpdatedEvent implements ActionInterface, Component
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Component status was updated.';
|
||||
return 'Component status was changed.';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\Component;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\Component\UpdateComponentCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\Component\ComponentStatusWasUpdatedEvent;
|
||||
use CachetHQ\Cachet\Bus\Events\Component\ComponentStatusWasChangedEvent;
|
||||
use CachetHQ\Cachet\Bus\Events\Component\ComponentWasUpdatedEvent;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
@@ -50,7 +50,7 @@ class UpdateComponentCommandHandler
|
||||
$component = $command->component;
|
||||
$originalStatus = $component->status;
|
||||
|
||||
event(new ComponentStatusWasUpdatedEvent($this->auth->user(), $component, $originalStatus, $command->status, $command->silent));
|
||||
event(new ComponentStatusWasChangedEvent($this->auth->user(), $component, $originalStatus, $command->status, $command->silent));
|
||||
|
||||
$component->update($this->filter($command));
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Events\Component;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\Component\ComponentStatusWasUpdatedEvent;
|
||||
use CachetHQ\Cachet\Bus\Events\Component\ComponentStatusWasChangedEvent;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
use CachetHQ\Cachet\Notifications\Component\ComponentStatusChangedNotification;
|
||||
@@ -40,11 +40,11 @@ class SendComponentUpdateEmailNotificationHandler
|
||||
/**
|
||||
* Handle the event.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Events\Component\ComponentStatusWasUpdatedEvent $event
|
||||
* @param \CachetHQ\Cachet\Bus\Events\Component\ComponentStatusWasChangedEvent $event
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(ComponentStatusWasUpdatedEvent $event)
|
||||
public function handle(ComponentStatusWasChangedEvent $event)
|
||||
{
|
||||
$component = $event->component;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class EventServiceProvider extends ServiceProvider
|
||||
'CachetHQ\Cachet\Bus\Events\ComponentGroup\ComponentGroupWasUpdatedEvent' => [
|
||||
//
|
||||
],
|
||||
'CachetHQ\Cachet\Bus\Events\Component\ComponentStatusWasUpdatedEvent' => [
|
||||
'CachetHQ\Cachet\Bus\Events\Component\ComponentStatusWasChangedEvent' => [
|
||||
'CachetHQ\Cachet\Bus\Handlers\Events\Component\SendComponentUpdateEmailNotificationHandler',
|
||||
],
|
||||
'CachetHQ\Cachet\Bus\Events\Component\ComponentWasAddedEvent' => [
|
||||
|
||||
@@ -11,18 +11,18 @@
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Bus\Events\Component;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\Component\ComponentStatusWasUpdatedEvent;
|
||||
use CachetHQ\Cachet\Bus\Events\Component\ComponentStatusWasChangedEvent;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use MailThief\Testing\InteractsWithMail;
|
||||
|
||||
/**
|
||||
* This is the component status was updated event test.
|
||||
* This is the component status was changed event test.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class ComponentStatusWasUpdatedEventTest extends AbstractComponentEventTestCase
|
||||
class ComponentStatusWasChangedEventTest extends AbstractComponentEventTestCase
|
||||
{
|
||||
use DatabaseMigrations, InteractsWithMail;
|
||||
|
||||
@@ -40,7 +40,7 @@ class ComponentStatusWasUpdatedEventTest extends AbstractComponentEventTestCase
|
||||
|
||||
$subscriber->subscriptions()->create(['component_id' => $component->id]);
|
||||
|
||||
$this->app['events']->fire(new ComponentStatusWasUpdatedEvent($user, $component, 1, 2, false));
|
||||
$this->app['events']->fire(new ComponentStatusWasChangedEvent($user, $component, 1, 2, false));
|
||||
|
||||
$this->seeMessageFor($subscriber->email);
|
||||
$this->seeMessageWithSubject(trans('notifications.component.status_update.mail.subject'));
|
||||
@@ -65,7 +65,7 @@ class ComponentStatusWasUpdatedEventTest extends AbstractComponentEventTestCase
|
||||
'new_status' => 2,
|
||||
'silent' => false,
|
||||
];
|
||||
$object = new ComponentStatusWasUpdatedEvent(
|
||||
$object = new ComponentStatusWasChangedEvent(
|
||||
$params['user'],
|
||||
$params['component'],
|
||||
$params['original_status'],
|
||||
Reference in New Issue
Block a user