action: confirm accompanying period + create workflow

This commit is contained in:
2021-05-19 13:20:59 +02:00
parent 04e9e30972
commit 22aa4afc02
6 changed files with 203 additions and 20 deletions

View File

@@ -0,0 +1,27 @@
<?php
namespace Chill\PersonBundle\Tests\Workflows;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Workflow\Registry;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
class AccompanyingPeriodLifecycle extends KernelTestCase
{
protected function setUp()
{
self::bootKernel();
}
public function testConfirm()
{
$registry = self::$container->get(Registry::class);
$period = new AccompanyingPeriod(new \DateTime('now'));
$workflow = $registry->get($period);
$this->assertArrayHasKey('DRAFT', $workflow->getMarking($period)->getPlaces());
$this->assertTrue($workflow->can($period, 'confirm'));
}
}