setCustomFieldAllowList example

$event = new CartBeforeSerializationEvent($cart$customFieldAllowList);

        static::assertSame($cart$event->getCart());
        static::assertSame($customFieldAllowList$event->getCustomFieldAllowList());
    }

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

        $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');

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