Started working on event tests
This commit is contained in:
26
tests/Events/Component/AbstractComponentEventTestCase.php
Normal file
26
tests/Events/Component/AbstractComponentEventTestCase.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?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\Events\Component;
|
||||
|
||||
use AltThree\TestBench\EventTrait;
|
||||
use CachetHQ\Cachet\Events\Component\ComponentEventInterface;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
abstract class AbstractComponentEventTestCase extends AbstractTestCase
|
||||
{
|
||||
use EventTrait;
|
||||
|
||||
protected function getEventInterfaces()
|
||||
{
|
||||
return [ComponentEventInterface::class];
|
||||
}
|
||||
}
|
||||
31
tests/Events/Component/ComponentWasAddedEventTest.php
Normal file
31
tests/Events/Component/ComponentWasAddedEventTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?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\Events\Component;
|
||||
|
||||
use CachetHQ\Cachet\Events\Component\ComponentWasAddedEvent;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
|
||||
class ComponentWasAddedEventTest extends AbstractComponentEventTestCase
|
||||
{
|
||||
protected function objectHasHandlers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getObjectAndParams()
|
||||
{
|
||||
$params = ['component' => new Component()];
|
||||
$object = new ComponentWasAddedEvent($params['component']);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
}
|
||||
31
tests/Events/Component/ComponentWasRemovedEventTest.php
Normal file
31
tests/Events/Component/ComponentWasRemovedEventTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?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\Events\Component;
|
||||
|
||||
use CachetHQ\Cachet\Events\Component\ComponentWasRemovedEvent;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
|
||||
class ComponentWasRemovedEventTest extends AbstractComponentEventTestCase
|
||||
{
|
||||
protected function objectHasHandlers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getObjectAndParams()
|
||||
{
|
||||
$params = ['component' => new Component()];
|
||||
$object = new ComponentWasRemovedEvent($params['component']);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
}
|
||||
31
tests/Events/Component/ComponentWasUpdatedEventTest.php
Normal file
31
tests/Events/Component/ComponentWasUpdatedEventTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?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\Events\Component;
|
||||
|
||||
use CachetHQ\Cachet\Events\Component\ComponentWasUpdatedEvent;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
|
||||
class ComponentWasUpdatedEventTest extends AbstractComponentEventTestCase
|
||||
{
|
||||
protected function objectHasHandlers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getObjectAndParams()
|
||||
{
|
||||
$params = ['component' => new Component()];
|
||||
$object = new ComponentWasUpdatedEvent($params['component']);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?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\Events\ComponentGroup;
|
||||
|
||||
use AltThree\TestBench\EventTrait;
|
||||
use CachetHQ\Cachet\Events\ComponentGroup\ComponentGroupEventInterface;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
abstract class AbstractComponentGroupEventTestCase extends AbstractTestCase
|
||||
{
|
||||
use EventTrait;
|
||||
|
||||
protected function getEventInterfaces()
|
||||
{
|
||||
return [ComponentGroupEventInterface::class];
|
||||
}
|
||||
}
|
||||
31
tests/Events/ComponentGroup/ComponentGroupWasAddedTest.php
Normal file
31
tests/Events/ComponentGroup/ComponentGroupWasAddedTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?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\Events\ComponentGroup;
|
||||
|
||||
use CachetHQ\Cachet\Events\ComponentGroup\ComponentGroupWasAddedEvent;
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
|
||||
class ComponentGroupWasAddedEventTest extends AbstractComponentGroupEventTestCase
|
||||
{
|
||||
protected function objectHasHandlers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getObjectAndParams()
|
||||
{
|
||||
$params = ['group' => new ComponentGroup()];
|
||||
$object = new ComponentGroupWasAddedEvent($params['group']);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?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\Events\ComponentGroup;
|
||||
|
||||
use CachetHQ\Cachet\Events\ComponentGroup\ComponentGroupWasRemovedEvent;
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
|
||||
class ComponentGroupWasRemovedEventTest extends AbstractComponentGroupEventTestCase
|
||||
{
|
||||
protected function objectHasHandlers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getObjectAndParams()
|
||||
{
|
||||
$params = ['group' => new ComponentGroup()];
|
||||
$object = new ComponentGroupWasRemovedEvent($params['group']);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?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\Events\ComponentGroup;
|
||||
|
||||
use CachetHQ\Cachet\Events\ComponentGroup\ComponentGroupWasUpdatedEvent;
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
|
||||
class ComponentGroupWasUpdatedEventTest extends AbstractComponentGroupEventTestCase
|
||||
{
|
||||
protected function objectHasHandlers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getObjectAndParams()
|
||||
{
|
||||
$params = ['group' => new ComponentGroup()];
|
||||
$object = new ComponentGroupWasUpdatedEvent($params['group']);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
}
|
||||
26
tests/Events/Incident/AbstractIncidentEventTestCase.php
Normal file
26
tests/Events/Incident/AbstractIncidentEventTestCase.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?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\Events\Incident;
|
||||
|
||||
use AltThree\TestBench\EventTrait;
|
||||
use CachetHQ\Cachet\Events\Incident\IncidentEventInterface;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
abstract class AbstractIncidentEventTestCase extends AbstractTestCase
|
||||
{
|
||||
use EventTrait;
|
||||
|
||||
protected function getEventInterfaces()
|
||||
{
|
||||
return [IncidentEventInterface::class];
|
||||
}
|
||||
}
|
||||
26
tests/Events/Invite/AbstractInviteEventTestCase.php
Normal file
26
tests/Events/Invite/AbstractInviteEventTestCase.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?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\Events\Invite;
|
||||
|
||||
use AltThree\TestBench\EventTrait;
|
||||
use CachetHQ\Cachet\Events\Invite\InviteEventInterface;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
abstract class AbstractInviteEventTestCase extends AbstractTestCase
|
||||
{
|
||||
use EventTrait;
|
||||
|
||||
protected function getEventInterfaces()
|
||||
{
|
||||
return [InviteEventInterface::class];
|
||||
}
|
||||
}
|
||||
26
tests/Events/Metric/AbstractMetricEventTestCase.php
Normal file
26
tests/Events/Metric/AbstractMetricEventTestCase.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?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\Events\Metric;
|
||||
|
||||
use AltThree\TestBench\EventTrait;
|
||||
use CachetHQ\Cachet\Events\Metric\MetricEventInterface;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
abstract class AbstractMetricEventTestCase extends AbstractTestCase
|
||||
{
|
||||
use EventTrait;
|
||||
|
||||
protected function getEventInterfaces()
|
||||
{
|
||||
return [MetricEventInterface::class];
|
||||
}
|
||||
}
|
||||
31
tests/Events/Metric/MetricWasAddedEventTest.php
Normal file
31
tests/Events/Metric/MetricWasAddedEventTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?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\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Events\Metric\MetricWasAddedEvent;
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
|
||||
class MetricWasAddedEventTest extends AbstractMetricEventTestCase
|
||||
{
|
||||
protected function objectHasHandlers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getObjectAndParams()
|
||||
{
|
||||
$params = ['metric' => new Metric()];
|
||||
$object = new MetricWasAddedEvent($params['metric']);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
}
|
||||
31
tests/Events/Metric/MetricWasRemovedEventTest.php
Normal file
31
tests/Events/Metric/MetricWasRemovedEventTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?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\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Events\Metric\MetricWasRemovedEvent;
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
|
||||
class MetricWasRemovedEventTest extends AbstractMetricEventTestCase
|
||||
{
|
||||
protected function objectHasHandlers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getObjectAndParams()
|
||||
{
|
||||
$params = ['metric' => new Metric()];
|
||||
$object = new MetricWasRemovedEvent($params['metric']);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
}
|
||||
31
tests/Events/Metric/MetricWasUpdatedEventTest.php
Normal file
31
tests/Events/Metric/MetricWasUpdatedEventTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?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\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Events\Metric\MetricWasUpdatedEvent;
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
|
||||
class MetricWasUpdatedEventTest extends AbstractMetricEventTestCase
|
||||
{
|
||||
protected function objectHasHandlers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getObjectAndParams()
|
||||
{
|
||||
$params = ['metric' => new Metric()];
|
||||
$object = new MetricWasUpdatedEvent($params['metric']);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
}
|
||||
26
tests/Events/Subscriber/AbstractSubscriberEventTestCase.php
Normal file
26
tests/Events/Subscriber/AbstractSubscriberEventTestCase.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?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\Events\Subscriber;
|
||||
|
||||
use AltThree\TestBench\EventTrait;
|
||||
use CachetHQ\Cachet\Events\Subscriber\SubscriberEventInterface;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
abstract class AbstractSubscriberEventTestCase extends AbstractTestCase
|
||||
{
|
||||
use EventTrait;
|
||||
|
||||
protected function getEventInterfaces()
|
||||
{
|
||||
return [SubscriberEventInterface::class];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user