Skip to content

Commit

Permalink
Merge pull request #2011 from CachetHQ/event-tests
Browse files Browse the repository at this point in the history
Added missing event tests
  • Loading branch information
jbrooksuk committed Jul 26, 2016
2 parents e6edcd3 + db7b332 commit 0ad792a
Show file tree
Hide file tree
Showing 9 changed files with 324 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tests/Bus/Events/Incident/IncidentWasRemovedEventTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?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\Incident;

use CachetHQ\Cachet\Bus\Events\Incident\IncidentWasRemovedEvent;
use CachetHQ\Cachet\Models\Incident;

/**
* This is the incident was removed event test class.
*
* @author James Brooks <[email protected]>
*/
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');
}
}
36 changes: 36 additions & 0 deletions tests/Bus/Events/Incident/IncidentWasReportedEventTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?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\Incident;

use CachetHQ\Cachet\Bus\Events\Incident\IncidentWasReportedEvent;
use CachetHQ\Cachet\Models\Incident;

/**
* This is the incident was reported event test class.
*
* @author James Brooks <[email protected]>
*/
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');
}
}
36 changes: 36 additions & 0 deletions tests/Bus/Events/Incident/IncidentWasUpdatedEventTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?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\Incident;

use CachetHQ\Cachet\Bus\Events\Incident\IncidentWasUpdatedEvent;
use CachetHQ\Cachet\Models\Incident;

/**
* This is the incident was updated event test class.
*
* @author James Brooks <[email protected]>
*/
class IncidentWasUpdatedEventTest extends AbstractIncidentEventTestCase
{
protected function objectHasHandlers()
{
return true;
}

protected function getObjectAndParams()
{
$params = ['incident' => new Incident()];
$object = new IncidentWasUpdatedEvent($params['incident']);

return compact('params', 'object');
}
}
36 changes: 36 additions & 0 deletions tests/Bus/Events/Incident/MaintenanceWasScheduledEventTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?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\Incident;

use CachetHQ\Cachet\Bus\Events\Incident\MaintenanceWasScheduledEvent;
use CachetHQ\Cachet\Models\Incident;

/**
* This is the maintenance was scheduled event test class.
*
* @author James Brooks <[email protected]>
*/
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');
}
}
36 changes: 36 additions & 0 deletions tests/Bus/Events/Metric/MetricPointWasAddedEventTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?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\Metric;

use CachetHQ\Cachet\Bus\Events\Metric\MetricPointWasAddedEvent;
use CachetHQ\Cachet\Models\Metric;

/**
* This is the metric point was added event test class.
*
* @author James Brooks <[email protected]>
*/
class MetricPointWasAddedEventTest extends AbstractMetricEventTestCase
{
protected function objectHasHandlers()
{
return false;
}

protected function getObjectAndParams()
{
$params = ['metric' => new Metric()];
$object = new MetricPointWasAddedEvent($params['metric']);

return compact('params', 'object');
}
}
36 changes: 36 additions & 0 deletions tests/Bus/Events/Metric/MetricPointWasRemovedEventTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?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\Metric;

use CachetHQ\Cachet\Bus\Events\Metric\MetricPointWasRemovedEvent;
use CachetHQ\Cachet\Models\Metric;

/**
* This is the metric point was removed event test class.
*
* @author James Brooks <[email protected]>
*/
class MetricPointWasRemovedEventTest extends AbstractMetricEventTestCase
{
protected function objectHasHandlers()
{
return false;
}

protected function getObjectAndParams()
{
$params = ['metric' => new Metric()];
$object = new MetricPointWasRemovedEvent($params['metric']);

return compact('params', 'object');
}
}
36 changes: 36 additions & 0 deletions tests/Bus/Events/Metric/MetricPointWasUpdatedEventTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?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\Metric;

use CachetHQ\Cachet\Bus\Events\Metric\MetricPointWasUpdatedEvent;
use CachetHQ\Cachet\Models\Metric;

/**
* This is the metric point was updated event test class.
*
* @author James Brooks <[email protected]>
*/
class MetricPointWasUpdatedEventTest extends AbstractMetricEventTestCase
{
protected function objectHasHandlers()
{
return false;
}

protected function getObjectAndParams()
{
$params = ['metric' => new Metric()];
$object = new MetricPointWasUpdatedEvent($params['metric']);

return compact('params', 'object');
}
}
36 changes: 36 additions & 0 deletions tests/Bus/Events/User/UserWasInvitedEventTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?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\UserWasInvitedEvent;
use CachetHQ\Cachet\Models\User;

/**
* This is the user was invited event test class.
*
* @author James Brooks <[email protected]>
*/
class UserWasInvitedEventTest extends AbstractUserEventTestCase
{
protected function objectHasHandlers()
{
return false;
}

protected function getObjectAndParams()
{
$params = ['user' => new User()];
$object = new UserWasInvitedEvent($params['user']);

return compact('params', 'object');
}
}
36 changes: 36 additions & 0 deletions tests/Bus/Events/User/UserWasRemovedEventTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?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\UserWasRemovedEvent;
use CachetHQ\Cachet\Models\User;

/**
* This is the user was removed event test class.
*
* @author James Brooks <[email protected]>
*/
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');
}
}

0 comments on commit 0ad792a

Please sign in to comment.