Skip to content

Commit

Permalink
Added missing event tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrooksuk committed Aug 4, 2016
1 parent e412c98 commit 1285d19
Show file tree
Hide file tree
Showing 12 changed files with 423 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/Bus/Events/System/AbstractSystemEventTestCase.php
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
*/
abstract class AbstractSystemEventTestCase extends AbstractTestCase
{
use EventTrait;

protected function getEventInterfaces()
{
return [SystemEventInterface::class];
}
}
35 changes: 35 additions & 0 deletions tests/Bus/Events/System/SystemCheckedForUpdatesEventTest.php
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
*/
class SystemCheckedForUpdatesEventTest extends AbstractSystemEventTestCase
{
protected function objectHasHandlers()
{
return false;
}

protected function getObjectAndParams()
{
$params = [];
$object = new SystemCheckedForUpdatesEvent();

return compact('params', 'object');
}
}
35 changes: 35 additions & 0 deletions tests/Bus/Events/System/SystemWasInstalledEventTest.php
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
*/
class SystemWasInstalledEventTest extends AbstractSystemEventTestCase
{
protected function objectHasHandlers()
{
return false;
}

protected function getObjectAndParams()
{
$params = [];
$object = new SystemWasInstalledEvent();

return compact('params', 'object');
}
}
35 changes: 35 additions & 0 deletions tests/Bus/Events/System/SystemWasResetEventTest.php
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
*/
class SystemWasResetEventTest extends AbstractSystemEventTestCase
{
protected function objectHasHandlers()
{
return false;
}

protected function getObjectAndParams()
{
$params = [];
$object = new SystemWasResetEvent();

return compact('params', 'object');
}
}
35 changes: 35 additions & 0 deletions tests/Bus/Events/System/SystemWasUpdatedEventTest.php
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
*/
class SystemWasUpdatedEventTest extends AbstractSystemEventTestCase
{
protected function objectHasHandlers()
{
return false;
}

protected function getObjectAndParams()
{
$params = [];
$object = new SystemWasUpdatedEvent();

return compact('params', 'object');
}
}
36 changes: 36 additions & 0 deletions tests/Bus/Events/User/UserDisabledTwoAuthEventTest.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\UserDisabledTwoAuthEvent;
use CachetHQ\Cachet\Models\User;

/**
* This is the user disabled two auth event test class.
*
* @author James Brooks <[email protected]>
*/
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');
}
}
36 changes: 36 additions & 0 deletions tests/Bus/Events/User/UserEnabledTwoAuthEventTest.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\UserEnabledTwoAuthEvent;
use CachetHQ\Cachet\Models\User;

/**
* This is the user enabled two auth event test class.
*
* @author James Brooks <[email protected]>
*/
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');
}
}
36 changes: 36 additions & 0 deletions tests/Bus/Events/User/UserFailedTwoAuthEventTest.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\UserFailedTwoAuthEvent;
use CachetHQ\Cachet\Models\User;

/**
* This is the user failed two auth event test class.
*
* @author James Brooks <[email protected]>
*/
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');
}
}
36 changes: 36 additions & 0 deletions tests/Bus/Events/User/UserLoggedInEventTest.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\UserLoggedInEvent;
use CachetHQ\Cachet\Models\User;

/**
* This is the user logged in event test class.
*
* @author James Brooks <[email protected]>
*/
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');
}
}
36 changes: 36 additions & 0 deletions tests/Bus/Events/User/UserLoggedOutEventTest.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\UserLoggedOutEvent;
use CachetHQ\Cachet\Models\User;

/**
* This is the user logged out event test class.
*
* @author James Brooks <[email protected]>
*/
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');
}
}
36 changes: 36 additions & 0 deletions tests/Bus/Events/User/UserPassedTwoAuthEventTest.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\UserPassedTwoAuthEvent;
use CachetHQ\Cachet\Models\User;

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

0 comments on commit 1285d19

Please sign in to comment.