Rename Command directory to Action to avoid confusion with symfony commands

This commit is contained in:
2024-04-17 10:29:08 +02:00
parent 36bc4dab24
commit 7c1f3b114d
7 changed files with 16 additions and 16 deletions

View File

@@ -0,0 +1,48 @@
<?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\TicketBundle\Tests\Action\Ticket\Handler;
use Chill\TicketBundle\Action\Ticket\CreateTicketCommand;
use Chill\TicketBundle\Action\Ticket\Handler\CreateTicketCommandHandler;
use Chill\TicketBundle\Entity\Ticket;
use PHPUnit\Framework\TestCase;
/**
* @internal
*
* @coversNothing
*/
class CreateTicketCommandHandlerTest extends TestCase
{
private function getHandler(): CreateTicketCommandHandler
{
return new CreateTicketCommandHandler();
}
public function testHandleWithoutReference(): void
{
$command = new CreateTicketCommand();
$actual = ($this->getHandler())($command);
self::assertInstanceOf(Ticket::class, $actual);
self::assertEquals('', $actual->getExternalRef());
}
public function testHandleWithReference(): void
{
$command = new CreateTicketCommand($ref = 'external-ref');
$actual = ($this->getHandler())($command);
self::assertInstanceOf(Ticket::class, $actual);
self::assertEquals($ref, $actual->getExternalRef());
}
}