Added missing event tests

This commit is contained in:
James Brooks
2016-08-04 09:02:42 +01:00
parent e412c988e6
commit 1285d19cd4
12 changed files with 423 additions and 0 deletions

View 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\Bus\Events\System;
use AltThree\TestBench\EventTrait;
use CachetHQ\Cachet\Bus\Events\System\SystemEventInterface;
use CachetHQ\Tests\Cachet\AbstractTestCase;
/**
* This is the abstract system event test class.
*
* @author James Brooks <james@alt-three.com>
*/
abstract class AbstractSystemEventTestCase extends AbstractTestCase
{
use EventTrait;
protected function getEventInterfaces()
{
return [SystemEventInterface::class];
}
}

View File

@@ -0,0 +1,35 @@
<?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\System;
use CachetHQ\Cachet\Bus\Events\System\SystemCheckedForUpdatesEvent;
/**
* This is the system checked for updates event test class.
*
* @author James Brooks <james@alt-three.com>
*/
class SystemCheckedForUpdatesEventTest extends AbstractSystemEventTestCase
{
protected function objectHasHandlers()
{
return false;
}
protected function getObjectAndParams()
{
$params = [];
$object = new SystemCheckedForUpdatesEvent();
return compact('params', 'object');
}
}

View File

@@ -0,0 +1,35 @@
<?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\System;
use CachetHQ\Cachet\Bus\Events\System\SystemWasInstalledEvent;
/**
* This is the system was installed event test class.
*
* @author James Brooks <james@alt-three.com>
*/
class SystemWasInstalledEventTest extends AbstractSystemEventTestCase
{
protected function objectHasHandlers()
{
return false;
}
protected function getObjectAndParams()
{
$params = [];
$object = new SystemWasInstalledEvent();
return compact('params', 'object');
}
}

View File

@@ -0,0 +1,35 @@
<?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\System;
use CachetHQ\Cachet\Bus\Events\System\SystemWasResetEvent;
/**
* This is the system was reset event test class.
*
* @author James Brooks <james@alt-three.com>
*/
class SystemWasResetEventTest extends AbstractSystemEventTestCase
{
protected function objectHasHandlers()
{
return false;
}
protected function getObjectAndParams()
{
$params = [];
$object = new SystemWasResetEvent();
return compact('params', 'object');
}
}

View File

@@ -0,0 +1,35 @@
<?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\System;
use CachetHQ\Cachet\Bus\Events\System\SystemWasUpdatedEvent;
/**
* This is the system was updated event test class.
*
* @author James Brooks <james@alt-three.com>
*/
class SystemWasUpdatedEventTest extends AbstractSystemEventTestCase
{
protected function objectHasHandlers()
{
return false;
}
protected function getObjectAndParams()
{
$params = [];
$object = new SystemWasUpdatedEvent();
return compact('params', 'object');
}
}

View File

@@ -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\UserDisabledTwoAuthEvent;
use CachetHQ\Cachet\Models\User;
/**
* This is the user disabled two auth event test class.
*
* @author James Brooks <james@alt-three.com>
*/
class UserDisabledTwoAuthEventTest extends AbstractUserEventTestCase
{
protected function objectHasHandlers()
{
return false;
}
protected function getObjectAndParams()
{
$params = ['user' => new User()];
$object = new UserDisabledTwoAuthEvent($params['user']);
return compact('params', 'object');
}
}

View File

@@ -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\UserEnabledTwoAuthEvent;
use CachetHQ\Cachet\Models\User;
/**
* This is the user enabled two auth event test class.
*
* @author James Brooks <james@alt-three.com>
*/
class UserEnabledTwoAuthEventTest extends AbstractUserEventTestCase
{
protected function objectHasHandlers()
{
return false;
}
protected function getObjectAndParams()
{
$params = ['user' => new User()];
$object = new UserEnabledTwoAuthEvent($params['user']);
return compact('params', 'object');
}
}

View File

@@ -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\UserFailedTwoAuthEvent;
use CachetHQ\Cachet\Models\User;
/**
* This is the user failed two auth event test class.
*
* @author James Brooks <james@alt-three.com>
*/
class UserFailedTwoAuthEventTest extends AbstractUserEventTestCase
{
protected function objectHasHandlers()
{
return false;
}
protected function getObjectAndParams()
{
$params = ['user' => new User()];
$object = new UserFailedTwoAuthEvent($params['user']);
return compact('params', 'object');
}
}

View File

@@ -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\UserLoggedInEvent;
use CachetHQ\Cachet\Models\User;
/**
* This is the user logged in event test class.
*
* @author James Brooks <james@alt-three.com>
*/
class UserLoggedInEventTest extends AbstractUserEventTestCase
{
protected function objectHasHandlers()
{
return false;
}
protected function getObjectAndParams()
{
$params = ['user' => new User()];
$object = new UserLoggedInEvent($params['user']);
return compact('params', 'object');
}
}

View File

@@ -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\UserLoggedOutEvent;
use CachetHQ\Cachet\Models\User;
/**
* This is the user logged out event test class.
*
* @author James Brooks <james@alt-three.com>
*/
class UserLoggedOutEventTest extends AbstractUserEventTestCase
{
protected function objectHasHandlers()
{
return false;
}
protected function getObjectAndParams()
{
$params = ['user' => new User()];
$object = new UserLoggedOutEvent($params['user']);
return compact('params', 'object');
}
}

View File

@@ -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\UserPassedTwoAuthEvent;
use CachetHQ\Cachet\Models\User;
/**
* This is the user passed two auth event test class.
*
* @author James Brooks <james@alt-three.com>
*/
class UserPassedTwoAuthEventTest extends AbstractUserEventTestCase
{
protected function objectHasHandlers()
{
return false;
}
protected function getObjectAndParams()
{
$params = ['user' => new User()];
$object = new UserPassedTwoAuthEvent($params['user']);
return compact('params', 'object');
}
}

View File

@@ -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\UserRegeneratedApiTokenEvent;
use CachetHQ\Cachet\Models\User;
/**
* This is the user regenerated api token event test class.
*
* @author James Brooks <james@alt-three.com>
*/
class UserRegeneratedApiTokenEventTest extends AbstractUserEventTestCase
{
protected function objectHasHandlers()
{
return false;
}
protected function getObjectAndParams()
{
$params = ['user' => new User()];
$object = new UserRegeneratedApiTokenEvent($params['user']);
return compact('params', 'object');
}
}