addCustomFieldToAllowList example

$event = new CartBeforeSerializationEvent(new Cart('cart')$customFieldAllowList);
        $event->setCustomFieldAllowList(['boo']);

        static::assertSame(['boo']$event->getCustomFieldAllowList());
    }

    public function testAddCustomFieldAllowList(): void
    {
        $customFieldAllowList = ['foo', 'bar'];

        $event = new CartBeforeSerializationEvent(new Cart('cart')$customFieldAllowList);
        $event->addCustomFieldToAllowList('boo');

        static::assertSame(['foo', 'bar', 'boo']$event->getCustomFieldAllowList());
    }
}
Home | Imprint | This part of the site doesn't use cookies.