Remove old Tag commands, refactor migration etc

This commit is contained in:
James Brooks
2019-07-12 11:08:25 +01:00
parent 32a3adb43c
commit 3ac7492858
17 changed files with 5 additions and 680 deletions

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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());
}
}