Rename Bus Add to Create

This commit is contained in:
James Brooks
2017-03-18 09:30:36 +00:00
parent 7d27c61abe
commit a55575656d
34 changed files with 163 additions and 116 deletions
@@ -12,17 +12,17 @@
namespace CachetHQ\Tests\Cachet\Bus\Commands\Component;
use AltThree\TestBench\CommandTrait;
use CachetHQ\Cachet\Bus\Commands\Component\AddComponentCommand;
use CachetHQ\Cachet\Bus\Handlers\Commands\Component\AddComponentCommandHandler;
use CachetHQ\Cachet\Bus\Commands\Component\CreateComponentCommand;
use CachetHQ\Cachet\Bus\Handlers\Commands\Component\CreateComponentCommandHandler;
use CachetHQ\Tests\Cachet\AbstractTestCase;
/**
* This is the add component command test class.
* This is the create component command test class.
*
* @author James Brooks <james@alt-three.com>
* @author Graham Campbell <graham@alt-three.com>
*/
class AddComponentCommandTest extends AbstractTestCase
class CreateComponentCommandTest extends AbstractTestCase
{
use CommandTrait;
@@ -38,7 +38,7 @@ class AddComponentCommandTest extends AbstractTestCase
'enabled' => true,
'meta' => null,
];
$object = new AddComponentCommand(
$object = new CreateComponentCommand(
$params['name'],
$params['description'],
$params['status'],
@@ -59,6 +59,6 @@ class AddComponentCommandTest extends AbstractTestCase
protected function getHandlerClass()
{
return AddComponentCommandHandler::class;
return CreateComponentCommandHandler::class;
}
}
@@ -12,18 +12,18 @@
namespace CachetHQ\Tests\Cachet\Bus\Commands\ComponentGroup;
use AltThree\TestBench\CommandTrait;
use CachetHQ\Cachet\Bus\Commands\ComponentGroup\AddComponentGroupCommand;
use CachetHQ\Cachet\Bus\Handlers\Commands\ComponentGroup\AddComponentGroupCommandHandler;
use CachetHQ\Cachet\Bus\Commands\ComponentGroup\CreateComponentGroupCommand;
use CachetHQ\Cachet\Bus\Handlers\Commands\ComponentGroup\CreateComponentGroupCommandHandler;
use CachetHQ\Cachet\Models\ComponentGroup;
use CachetHQ\Tests\Cachet\AbstractTestCase;
/**
* This is the add component group command test class.
* This is the create component group command test class.
*
* @author James Brooks <james@alt-three.com>
* @author Graham Campbell <graham@alt-three.com>
*/
class AddComponentGroupCommandTest extends AbstractTestCase
class CreateComponentGroupCommandTest extends AbstractTestCase
{
use CommandTrait;
@@ -36,7 +36,7 @@ class AddComponentGroupCommandTest extends AbstractTestCase
'visible' => ComponentGroup::VISIBLE_AUTHENTICATED,
];
$object = new AddComponentGroupCommand(
$object = new CreateComponentGroupCommand(
$params['name'],
$params['order'],
$params['collapsed'],
@@ -53,6 +53,6 @@ class AddComponentGroupCommandTest extends AbstractTestCase
protected function getHandlerClass()
{
return AddComponentGroupCommandHandler::class;
return CreateComponentGroupCommandHandler::class;
}
}
@@ -12,17 +12,17 @@
namespace CachetHQ\Tests\Cachet\Bus\Commands\Metric;
use AltThree\TestBench\CommandTrait;
use CachetHQ\Cachet\Bus\Commands\Metric\AddMetricCommand;
use CachetHQ\Cachet\Bus\Handlers\Commands\Metric\AddMetricCommandHandler;
use CachetHQ\Cachet\Bus\Commands\Metric\CreateMetricCommand;
use CachetHQ\Cachet\Bus\Handlers\Commands\Metric\CreateMetricCommandHandler;
use CachetHQ\Tests\Cachet\AbstractTestCase;
/**
* This is the add metric command test class.
* This is the create metric command test class.
*
* @author James Brooks <james@alt-three.com>
* @author Graham Campbell <graham@alt-three.com>
*/
class AddMetricCommandTest extends AbstractTestCase
class CreateMetricCommandTest extends AbstractTestCase
{
use CommandTrait;
@@ -42,7 +42,7 @@ class AddMetricCommandTest extends AbstractTestCase
'visible' => 1,
];
$object = new AddMetricCommand(
$object = new CreateMetricCommand(
$params['name'],
$params['suffix'],
$params['description'],
@@ -66,6 +66,6 @@ class AddMetricCommandTest extends AbstractTestCase
protected function getHandlerClass()
{
return AddMetricCommandHandler::class;
return CreateMetricCommandHandler::class;
}
}
@@ -12,25 +12,25 @@
namespace CachetHQ\Tests\Cachet\Bus\Commands\Metric;
use AltThree\TestBench\CommandTrait;
use CachetHQ\Cachet\Bus\Commands\Metric\AddMetricPointCommand;
use CachetHQ\Cachet\Bus\Handlers\Commands\Metric\AddMetricPointCommandHandler;
use CachetHQ\Cachet\Bus\Commands\Metric\CreateMetricPointCommand;
use CachetHQ\Cachet\Bus\Handlers\Commands\Metric\CreateMetricPointCommandHandler;
use CachetHQ\Cachet\Models\Metric;
use CachetHQ\Tests\Cachet\AbstractTestCase;
/**
* This is the add metric point command test class.
* This is the create metric point command test class.
*
* @author James Brooks <james@alt-three.com>
* @author Graham Campbell <graham@alt-three.com>
*/
class AddMetricPointCommandTest extends AbstractTestCase
class CreateMetricPointCommandTest extends AbstractTestCase
{
use CommandTrait;
protected function getObjectAndParams()
{
$params = ['metric' => new Metric(), 'value' => 1, 'created_at' => '2020-12-30 12:00:00'];
$object = new AddMetricPointCommand($params['metric'], $params['value'], $params['created_at']);
$object = new CreateMetricPointCommand($params['metric'], $params['value'], $params['created_at']);
return compact('params', 'object');
}
@@ -42,6 +42,6 @@ class AddMetricPointCommandTest extends AbstractTestCase
protected function getHandlerClass()
{
return AddMetricPointCommandHandler::class;
return CreateMetricPointCommandHandler::class;
}
}
@@ -12,8 +12,8 @@
namespace CachetHQ\Tests\Cachet\Bus\Commands\User;
use AltThree\TestBench\CommandTrait;
use CachetHQ\Cachet\Bus\Commands\User\AddUserCommand;
use CachetHQ\Cachet\Bus\Handlers\Commands\User\AddUserCommandHandler;
use CachetHQ\Cachet\Bus\Commands\User\CreateUserCommand;
use CachetHQ\Cachet\Bus\Handlers\Commands\User\CreateUserCommandHandler;
use CachetHQ\Tests\Cachet\AbstractTestCase;
/**
@@ -22,7 +22,7 @@ use CachetHQ\Tests\Cachet\AbstractTestCase;
* @author James Brooks <james@alt-three.com>
* @author Graham Campbell <graham@alt-three.com>
*/
class AddUserCommandTest extends AbstractTestCase
class CreateUserCommandTest extends AbstractTestCase
{
use CommandTrait;
@@ -35,7 +35,7 @@ class AddUserCommandTest extends AbstractTestCase
'level' => 1,
];
$object = new AddUserCommand(
$object = new CreateUserCommand(
$params['username'],
$params['password'],
$params['email'],
@@ -52,6 +52,6 @@ class AddUserCommandTest extends AbstractTestCase
protected function getHandlerClass()
{
return AddUserCommandHandler::class;
return CreateUserCommandHandler::class;
}
}