2019-02-12 19:24:34 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace tests\Unit\Domain\FormManagement;
|
|
|
|
|
|
|
|
use PHPUnit\Framework\TestCase;
|
2019-02-17 14:33:19 +01:00
|
|
|
use Infinito\Domain\RequestManagement\Action\RequestedActionInterface;
|
|
|
|
use Infinito\Domain\FormManagement\RequestedActionFormBuilder;
|
|
|
|
use Infinito\Domain\FormManagement\FormClassNameServiceInterface;
|
2019-02-12 19:24:34 +01:00
|
|
|
use Symfony\Component\Form\FormFactoryInterface;
|
2019-04-15 01:37:17 +02:00
|
|
|
use Infinito\Exception\Attribut\UndefinedAttributException;
|
2019-02-12 19:24:34 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @author kevinfrantz
|
|
|
|
*/
|
|
|
|
class RequestedActionFormBuilderTest extends TestCase
|
|
|
|
{
|
|
|
|
public function testRequestedActionNotValid(): void
|
|
|
|
{
|
|
|
|
$requestedAction = $this->createMock(RequestedActionInterface::class);
|
|
|
|
$requestedAction->method('hasRequestedEntity')->willReturn(false);
|
|
|
|
$formFactory = $this->createMock(FormFactoryInterface::class);
|
|
|
|
$formClassNameService = $this->createMock(FormClassNameServiceInterface::class);
|
|
|
|
$requestedActionFormBuilder = new RequestedActionFormBuilder($formFactory, $formClassNameService);
|
2019-04-15 01:37:17 +02:00
|
|
|
$this->expectException(UndefinedAttributException::class);
|
2019-02-12 19:24:34 +01:00
|
|
|
$requestedActionFormBuilder->create($requestedAction);
|
|
|
|
}
|
|
|
|
}
|