diff --git a/app/Foundation/Providers/EventServiceProvider.php b/app/Foundation/Providers/EventServiceProvider.php index b8f18b9bcc3b..aaff317e9703 100644 --- a/app/Foundation/Providers/EventServiceProvider.php +++ b/app/Foundation/Providers/EventServiceProvider.php @@ -48,6 +48,9 @@ class EventServiceProvider extends ServiceProvider 'CachetHQ\Cachet\Bus\Events\Incident\IncidentWasUpdatedEvent' => [ // ], + 'CachetHQ\Cachet\Bus\Events\Incident\IncidentWasRemovedEvent' => [ + // + ], 'CachetHQ\Cachet\Bus\Events\Incident\MaintenanceWasScheduledEvent' => [ 'CachetHQ\Cachet\Bus\Handlers\Events\Incident\SendMaintenanceEmailNotificationHandler', ], @@ -90,5 +93,8 @@ class EventServiceProvider extends ServiceProvider 'CachetHQ\Cachet\Bus\Events\User\UserWasInvitedEvent' => [ 'CachetHQ\Cachet\Bus\Handlers\Events\User\SendInviteUserEmailHandler', ], + 'CachetHQ\Cachet\Bus\Events\User\UserWasRemovedEvent' => [ + // + ], ]; } diff --git a/tests/Bus/Commands/CommandExistenceTest.php b/tests/Bus/Commands/CommandExistenceTest.php new file mode 100644 index 000000000000..62106fbac303 --- /dev/null +++ b/tests/Bus/Commands/CommandExistenceTest.php @@ -0,0 +1,30 @@ + + */ +class CommandExistenceTest extends TestCase +{ + use ExistenceTrait; + + protected function getSourcePath() + { + return realpath(__DIR__.'/../../../app/Bus/Commands'); + } +} diff --git a/tests/Bus/Commands/Subscriber/UpdateSubscriberSubscriptionCommandTest.php b/tests/Bus/Commands/Subscriber/UpdateSubscriberSubscriptionCommandTest.php new file mode 100644 index 000000000000..86cb0a11d517 --- /dev/null +++ b/tests/Bus/Commands/Subscriber/UpdateSubscriberSubscriptionCommandTest.php @@ -0,0 +1,41 @@ + + */ +class UpdateSubscriberSubscriptionCommandTest extends AbstractTestCase +{ + use CommandTrait; + + protected function getObjectAndParams() + { + $params = ['subscriber' => new Subscriber(), 'subscriptions' => null]; + $object = new UpdateSubscriberSubscriptionCommand($params['subscriber'], $params['subscriptions']); + + return compact('params', 'object'); + } + + protected function getHandlerClass() + { + return UpdateSubscriberSubscriptionCommandHandler::class; + } +} diff --git a/tests/Bus/Events/EventExistenceTest.php b/tests/Bus/Events/EventExistenceTest.php new file mode 100644 index 000000000000..47983a7f3bf7 --- /dev/null +++ b/tests/Bus/Events/EventExistenceTest.php @@ -0,0 +1,30 @@ + + */ +class EventExistenceTest extends TestCase +{ + use ExistenceTrait; + + protected function getSourcePath() + { + return realpath(__DIR__.'/../../../app/Bus/Events'); + } +} diff --git a/tests/Bus/Events/Incident/IncidentWasRemovedEventTest.php b/tests/Bus/Events/Incident/IncidentWasRemovedEventTest.php new file mode 100644 index 000000000000..aadb73985816 --- /dev/null +++ b/tests/Bus/Events/Incident/IncidentWasRemovedEventTest.php @@ -0,0 +1,36 @@ + + */ +class IncidentWasRemovedEventTest extends AbstractIncidentEventTestCase +{ + protected function objectHasHandlers() + { + return false; + } + + protected function getObjectAndParams() + { + $params = ['incident' => new Incident()]; + $object = new IncidentWasRemovedEvent($params['incident']); + + return compact('params', 'object'); + } +} diff --git a/tests/Bus/Events/Incident/IncidentWasReportedEventTest.php b/tests/Bus/Events/Incident/IncidentWasReportedEventTest.php new file mode 100644 index 000000000000..c6f880f6e680 --- /dev/null +++ b/tests/Bus/Events/Incident/IncidentWasReportedEventTest.php @@ -0,0 +1,36 @@ + + */ +class IncidentWasReportedEventTest extends AbstractIncidentEventTestCase +{ + protected function objectHasHandlers() + { + return true; + } + + protected function getObjectAndParams() + { + $params = ['incident' => new Incident()]; + $object = new IncidentWasReportedEvent($params['incident']); + + return compact('params', 'object'); + } +} diff --git a/tests/Bus/Events/Incident/IncidentWasUpdatedEventTest.php b/tests/Bus/Events/Incident/IncidentWasUpdatedEventTest.php new file mode 100644 index 000000000000..732de05c6f30 --- /dev/null +++ b/tests/Bus/Events/Incident/IncidentWasUpdatedEventTest.php @@ -0,0 +1,36 @@ + + */ +class IncidentWasUpdatedEventTest extends AbstractIncidentEventTestCase +{ + protected function objectHasHandlers() + { + return false; + } + + protected function getObjectAndParams() + { + $params = ['incident' => new Incident()]; + $object = new IncidentWasUpdatedEvent($params['incident']); + + return compact('params', 'object'); + } +} diff --git a/tests/Bus/Events/Incident/MaintenanceWasScheduledEventTest.php b/tests/Bus/Events/Incident/MaintenanceWasScheduledEventTest.php new file mode 100644 index 000000000000..bf273cf06510 --- /dev/null +++ b/tests/Bus/Events/Incident/MaintenanceWasScheduledEventTest.php @@ -0,0 +1,36 @@ + + */ +class MaintenanceWasScheduledEventTest extends AbstractIncidentEventTestCase +{ + protected function objectHasHandlers() + { + return true; + } + + protected function getObjectAndParams() + { + $params = ['incident' => new Incident()]; + $object = new MaintenanceWasScheduledEvent($params['incident']); + + return compact('params', 'object'); + } +} diff --git a/tests/Bus/Events/Metric/MetricPointWasAddedEventTest.php b/tests/Bus/Events/Metric/MetricPointWasAddedEventTest.php new file mode 100644 index 000000000000..99fe8be33593 --- /dev/null +++ b/tests/Bus/Events/Metric/MetricPointWasAddedEventTest.php @@ -0,0 +1,36 @@ + + */ +class MetricPointWasAddedEventTest extends AbstractMetricEventTestCase +{ + protected function objectHasHandlers() + { + return false; + } + + protected function getObjectAndParams() + { + $params = ['metricPoint' => new MetricPoint()]; + $object = new MetricPointWasAddedEvent($params['metricPoint']); + + return compact('params', 'object'); + } +} diff --git a/tests/Bus/Events/Metric/MetricPointWasRemovedEventTest.php b/tests/Bus/Events/Metric/MetricPointWasRemovedEventTest.php new file mode 100644 index 000000000000..4c2a8c4f2ee2 --- /dev/null +++ b/tests/Bus/Events/Metric/MetricPointWasRemovedEventTest.php @@ -0,0 +1,36 @@ + + */ +class MetricPointWasRemovedEventTest extends AbstractMetricEventTestCase +{ + protected function objectHasHandlers() + { + return false; + } + + protected function getObjectAndParams() + { + $params = ['metricPoint' => new MetricPoint()]; + $object = new MetricPointWasRemovedEvent($params['metricPoint']); + + return compact('params', 'object'); + } +} diff --git a/tests/Bus/Events/Metric/MetricPointWasUpdatedEventTest.php b/tests/Bus/Events/Metric/MetricPointWasUpdatedEventTest.php new file mode 100644 index 000000000000..fd5b30997c40 --- /dev/null +++ b/tests/Bus/Events/Metric/MetricPointWasUpdatedEventTest.php @@ -0,0 +1,36 @@ + + */ +class MetricPointWasUpdatedEventTest extends AbstractMetricEventTestCase +{ + protected function objectHasHandlers() + { + return false; + } + + protected function getObjectAndParams() + { + $params = ['metricPoint' => new MetricPoint()]; + $object = new MetricPointWasUpdatedEvent($params['metricPoint']); + + return compact('params', 'object'); + } +} diff --git a/tests/Bus/Events/User/UserWasInvitedEventTest.php b/tests/Bus/Events/User/UserWasInvitedEventTest.php new file mode 100644 index 000000000000..acdfbd71e053 --- /dev/null +++ b/tests/Bus/Events/User/UserWasInvitedEventTest.php @@ -0,0 +1,36 @@ + + */ +class UserWasInvitedEventTest extends AbstractUserEventTestCase +{ + protected function objectHasHandlers() + { + return true; + } + + protected function getObjectAndParams() + { + $params = ['invite' => new Invite()]; + $object = new UserWasInvitedEvent($params['invite']); + + return compact('params', 'object'); + } +} diff --git a/tests/Bus/Events/User/UserWasRemovedEventTest.php b/tests/Bus/Events/User/UserWasRemovedEventTest.php new file mode 100644 index 000000000000..a6b72cff952c --- /dev/null +++ b/tests/Bus/Events/User/UserWasRemovedEventTest.php @@ -0,0 +1,36 @@ + + */ +class UserWasRemovedEventTest extends AbstractUserEventTestCase +{ + protected function objectHasHandlers() + { + return false; + } + + protected function getObjectAndParams() + { + $params = ['user' => new User()]; + $object = new UserWasRemovedEvent($params['user']); + + return compact('params', 'object'); + } +}