ScheduledTaskDefinition example

$event = new PreWriteValidationEvent(WriteContext::createFromContext(Context::createDefaultContext())[$inputCommand]);

        $subscriber = new ScheduledTaskCompatibilitySubscriber();
        $subscriber->addBackwardsCompatibility($event);

        static::assertEquals([$expectedCommand]$event->getCommands());
    }

    public function testSubscriberHasNoEffectWhenFeatureIsEnabled(): void
    {
        $dummyExistence = new EntityExistence('', [], true, true, true, []);
        $insertCommand = new InsertCommand(new ScheduledTaskDefinition()[
            'id' => 'id',
            'name' => 'name',
            'run_interval' => 1,
        ][]$dummyExistence, '');
        $event = new PreWriteValidationEvent(WriteContext::createFromContext(Context::createDefaultContext())[$insertCommand]);

        $subscriber = new ScheduledTaskCompatibilitySubscriber();
        $subscriber->addBackwardsCompatibility($event);

        static::assertEquals([$insertCommand]$event->getCommands());
    }

    
Home | Imprint | This part of the site doesn't use cookies.