getReviewFormData example



        Feature::triggerDeprecationOrThrow(
            'v6.6.0.0',
            Feature::deprecatedMethodMessage(self::class, __METHOD__, 'v6.6.0.0', 'Use ScalarValuesStorer instead')
        );

        if (!$event instanceof ReviewFormDataAware || isset($stored[ReviewFormDataAware::REVIEW_FORM_DATA])) {
            return $stored;
        }

        $stored[ReviewFormDataAware::REVIEW_FORM_DATA] = $event->getReviewFormData();

        return $stored;
    }

    public function restore(StorableFlow $storable): void
    {
        if (Feature::isActive('v6.6.0.0')) {
            return;
        }

        Feature::triggerDeprecationOrThrow(
            
$salesChannelId = 'foo';
        $mailRecipientStruct = new MailRecipientStruct(['foo' => 'bar']);
        $data = new DataBag(['baz']);
        $productId = 'bar';
        $customerId = 'bar';

        $event = new ReviewFormEvent($context$salesChannelId$mailRecipientStruct$data$productId$customerId);

        static::assertEquals($context$event->getContext());
        static::assertEquals($salesChannelId$event->getSalesChannelId());
        static::assertEquals($mailRecipientStruct$event->getMailStruct());
        static::assertEquals($data->all()$event->getReviewFormData());
        static::assertEquals($productId$event->getProductId());
        static::assertEquals($customerId$event->getCustomerId());
    }

    public function testScalarValuesCorrectly(): void
    {
        $event = new ReviewFormEvent(
            Context::createDefaultContext(),
            'sales-channel-id',
            new MailRecipientStruct(['foo', 'bar']),
            new DataBag(['foo' => 'bar', 'bar' => 'baz']),
            
Home | Imprint | This part of the site doesn't use cookies.