mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-01-17 13:38:20 +01:00
commit
c73c5d28a1
@ -116,7 +116,7 @@ final class ReportIncidentCommand
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($name, $status, $message, $visible, $component_id, $component_status, $notify, $incident_date, $template, $template_vars)
|
||||
public function __construct($name, $status, $message, $visible, $component_id, $component_status, $notify, $incident_date, $template, array $template_vars = null)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->status = $status;
|
||||
|
@ -125,7 +125,7 @@ final class UpdateIncidentCommand
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Incident $incident, $name, $status, $message, $visible, $component_id, $component_status, $notify, $incident_date, $template, $template_vars)
|
||||
public function __construct(Incident $incident, $name, $status, $message, $visible, $component_id, $component_status, $notify, $incident_date, $template, array $template_vars = null)
|
||||
{
|
||||
$this->incident = $incident;
|
||||
$this->name = $name;
|
||||
|
@ -11,23 +11,25 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Commands\Invite;
|
||||
|
||||
use CachetHQ\Cachet\Models\Invite;
|
||||
|
||||
final class ClaimInviteCommand
|
||||
{
|
||||
/**
|
||||
* The invte to mark as claimed.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Model\Invite
|
||||
* @var \CachetHQ\Cachet\Models\Invite
|
||||
*/
|
||||
public $invite;
|
||||
|
||||
/**
|
||||
* Create a new claim invite command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Model\Invite $invite
|
||||
* @param \CachetHQ\Cachet\Models\Invite $invite
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($invite)
|
||||
public function __construct(Invite $invite)
|
||||
{
|
||||
$this->invite = $invite;
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ final class UnsubscribeSubscriberCommand
|
||||
/**
|
||||
* Create a unsubscribe subscriber command instance.
|
||||
*
|
||||
* @param string $subscriber
|
||||
* @param \CachetHQ\Cachet\Models\Subscriber $subscriber
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
@ -25,7 +25,7 @@ final class VerifySubscriberCommand
|
||||
/**
|
||||
* Create a verify subscriber command instance.
|
||||
*
|
||||
* @param string $subscriber
|
||||
* @param \CachetHQ\Cachet\Models\Subscriber $subscriber
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
@ -11,6 +11,8 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Commands\User;
|
||||
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class GenerateApiTokenCommand
|
||||
{
|
||||
/**
|
||||
@ -27,7 +29,7 @@ final class GenerateApiTokenCommand
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($user)
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
|
@ -32,11 +32,11 @@ final class InviteTeamMemberCommand
|
||||
/**
|
||||
* Create a new invite team member command instance.
|
||||
*
|
||||
* @param array $email
|
||||
* @param string[] $email
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($emails)
|
||||
public function __construct(array $emails)
|
||||
{
|
||||
$this->emails = $emails;
|
||||
}
|
||||
|
41
tests/Commands/Invite/ClaimInviteCommandTest.php
Normal file
41
tests/Commands/Invite/ClaimInviteCommandTest.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?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\Commands\Invite;
|
||||
|
||||
use AltThree\TestBench\CommandTrait;
|
||||
use CachetHQ\Cachet\Commands\Invite\ClaimInviteCommand;
|
||||
use CachetHQ\Cachet\Handlers\Commands\Invite\ClaimInviteCommandHandler;
|
||||
use CachetHQ\Cachet\Models\Invite;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
/**
|
||||
* This is the claim invite command test class.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
class ClaimInviteCommandTest extends AbstractTestCase
|
||||
{
|
||||
use CommandTrait;
|
||||
|
||||
protected function getObjectAndParams()
|
||||
{
|
||||
$params = ['invite' => new Invite()];
|
||||
$object = new ClaimInviteCommand($params['invite']);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
|
||||
protected function getHandlerClass()
|
||||
{
|
||||
return ClaimInviteCommandHandler::class;
|
||||
}
|
||||
}
|
45
tests/Commands/User/InviteTeamMemberCommandTest.php
Normal file
45
tests/Commands/User/InviteTeamMemberCommandTest.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?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\Commands\User;
|
||||
|
||||
use AltThree\TestBench\CommandTrait;
|
||||
use CachetHQ\Cachet\Commands\User\InviteTeamMemberCommand;
|
||||
use CachetHQ\Cachet\Handlers\Commands\User\InviteTeamMemberCommandHandler;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
/**
|
||||
* This is the invite team member command test class.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
class InviteTeamMemberCommandTest extends AbstractTestCase
|
||||
{
|
||||
use CommandTrait;
|
||||
|
||||
protected function getObjectAndParams()
|
||||
{
|
||||
$params = ['emails' => ['foo@example.com']];
|
||||
$object = new InviteTeamMemberCommand($params['emails']);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
|
||||
protected function objectHasRules()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function getHandlerClass()
|
||||
{
|
||||
return InviteTeamMemberCommandHandler::class;
|
||||
}
|
||||
}
|
56
tests/Commands/User/SignupUserCommandTest.php
Normal file
56
tests/Commands/User/SignupUserCommandTest.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?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\Commands\User;
|
||||
|
||||
use AltThree\TestBench\CommandTrait;
|
||||
use CachetHQ\Cachet\Commands\User\SignupUserCommand;
|
||||
use CachetHQ\Cachet\Handlers\Commands\User\SignupUserCommandHandler;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
/**
|
||||
* This is the signup user command test class.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
class SignupUserCommandTest extends AbstractTestCase
|
||||
{
|
||||
use CommandTrait;
|
||||
|
||||
protected function getObjectAndParams()
|
||||
{
|
||||
$params = [
|
||||
'username' => 'Test',
|
||||
'password' => 'fooey',
|
||||
'email' => 'test@test.com',
|
||||
'level' => 1,
|
||||
];
|
||||
|
||||
$object = new SignupUserCommand(
|
||||
$params['username'],
|
||||
$params['password'],
|
||||
$params['email'],
|
||||
$params['level']
|
||||
);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
|
||||
protected function objectHasRules()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function getHandlerClass()
|
||||
{
|
||||
return SignupUserCommandHandler::class;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user