chill-bundles/src/Bundle/ChillPersonBundle/Tests/Workflows/AccompanyingPeriodLifecycle.php

28 lines
708 B
PHP

<?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'));
}
}