mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-26 17:43:54 +00:00
Rename Command directory to Action to avoid confusion with symfony commands
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user