Remove old Tag commands, refactor migration etc
This commit is contained in:
@@ -1,54 +0,0 @@
|
||||
<?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\Commands\Tag;
|
||||
|
||||
use AltThree\TestBench\CommandTrait;
|
||||
use CachetHQ\Cachet\Bus\Commands\Tag\ApplyTagCommand;
|
||||
use CachetHQ\Cachet\Bus\Handlers\Commands\Tag\ApplyTagCommandHandler;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\Tag;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
/**
|
||||
* This is the apply tag command test class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class ApplyTagCommandTest extends AbstractTestCase
|
||||
{
|
||||
use CommandTrait;
|
||||
|
||||
protected function getObjectAndParams()
|
||||
{
|
||||
$params = [
|
||||
'model' => new Component(),
|
||||
'tag' => new Tag(),
|
||||
];
|
||||
|
||||
$object = new ApplyTagCommand(
|
||||
$params['model'],
|
||||
$params['tag']
|
||||
);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
|
||||
protected function objectHasRules()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getHandlerClass()
|
||||
{
|
||||
return ApplyTagCommandHandler::class;
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
<?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\Commands\Tag;
|
||||
|
||||
use AltThree\TestBench\CommandTrait;
|
||||
use CachetHQ\Cachet\Bus\Commands\Tag\CreateTagCommand;
|
||||
use CachetHQ\Cachet\Bus\Handlers\Commands\Tag\CreateTagCommandHandler;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
/**
|
||||
* This is the create tag command test class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class CreateTagCommandTest extends AbstractTestCase
|
||||
{
|
||||
use CommandTrait;
|
||||
|
||||
protected function getObjectAndParams()
|
||||
{
|
||||
$params = [
|
||||
'name' => 'Test',
|
||||
'slug' => 'test',
|
||||
];
|
||||
|
||||
$object = new CreateTagCommand(
|
||||
$params['name'],
|
||||
$params['slug']
|
||||
);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
|
||||
protected function objectHasRules()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getHandlerClass()
|
||||
{
|
||||
return CreateTagCommandHandler::class;
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
<?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\Commands\Tag;
|
||||
|
||||
use AltThree\TestBench\CommandTrait;
|
||||
use CachetHQ\Cachet\Bus\Commands\Tag\DeleteTagCommand;
|
||||
use CachetHQ\Cachet\Bus\Handlers\Commands\Tag\DeleteTagCommandHandler;
|
||||
use CachetHQ\Cachet\Models\Tag;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
/**
|
||||
* This is the delete tag command test class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class DeleteTagCommandTest extends AbstractTestCase
|
||||
{
|
||||
use CommandTrait;
|
||||
|
||||
protected function getObjectAndParams()
|
||||
{
|
||||
$params = [
|
||||
'tag' => new Tag(),
|
||||
];
|
||||
|
||||
$object = new DeleteTagCommand(
|
||||
$params['tag']
|
||||
);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
|
||||
protected function objectHasRules()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getHandlerClass()
|
||||
{
|
||||
return DeleteTagCommandHandler::class;
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
<?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\Commands\Tag;
|
||||
|
||||
use AltThree\TestBench\CommandTrait;
|
||||
use CachetHQ\Cachet\Bus\Commands\Tag\UpdateTagCommand;
|
||||
use CachetHQ\Cachet\Bus\Handlers\Commands\Tag\UpdateTagCommandHandler;
|
||||
use CachetHQ\Cachet\Models\Tag;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
/**
|
||||
* This is the update tag command test class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class UpdateTagCommandTest extends AbstractTestCase
|
||||
{
|
||||
use CommandTrait;
|
||||
|
||||
protected function getObjectAndParams()
|
||||
{
|
||||
$params = [
|
||||
'tag' => new Tag(),
|
||||
'name' => 'Test',
|
||||
'slug' => 'test',
|
||||
];
|
||||
|
||||
$object = new UpdateTagCommand(
|
||||
$params['tag'],
|
||||
$params['name'],
|
||||
$params['slug']
|
||||
);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
|
||||
protected function objectHasRules()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getHandlerClass()
|
||||
{
|
||||
return UpdateTagCommandHandler::class;
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
<?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\Models;
|
||||
|
||||
use AltThree\TestBench\ValidationTrait;
|
||||
use CachetHQ\Cachet\Models\Taggable;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
/**
|
||||
* This is the taggable model test class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class TaggableTest extends AbstractTestCase
|
||||
{
|
||||
use ValidationTrait;
|
||||
|
||||
public function testValidation()
|
||||
{
|
||||
$this->checkRules(new Taggable());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user