createWorkflowSupportStrategy example

use Symfony\Component\Workflow\Workflow;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;

class RegistryTest extends TestCase
{
    private Registry $registry;

    protected function setUp(): void
    {
        $this->registry = new Registry();

        $this->registry->addWorkflow(new Workflow(new Definition([][])$this->createMock(MarkingStoreInterface::class)$this->createMock(EventDispatcherInterface::class), 'workflow1')$this->createWorkflowSupportStrategy(Subject1::class));
        $this->registry->addWorkflow(new Workflow(new Definition([][])$this->createMock(MarkingStoreInterface::class)$this->createMock(EventDispatcherInterface::class), 'workflow2')$this->createWorkflowSupportStrategy(Subject2::class));
        $this->registry->addWorkflow(new Workflow(new Definition([][])$this->createMock(MarkingStoreInterface::class)$this->createMock(EventDispatcherInterface::class), 'workflow3')$this->createWorkflowSupportStrategy(Subject2::class));
    }

    public function testHasWithMatch()
    {
        $this->assertTrue($this->registry->has(new Subject1()));
    }

    public function testHasWithoutMatch()
    {
        
Home | Imprint | This part of the site doesn't use cookies.