CustomerSerializer example

private string $paymentMethodId = '733530bc28f74bfbb43c32b595ac9fa0';

    protected function setUp(): void
    {
        $this->customerGroupRepository = $this->getContainer()->get('customer_group.repository');
        $this->paymentMethodRepository = $this->getContainer()->get('payment_method.repository');
        $this->salesChannelRepository = $this->getContainer()->get('sales_channel.repository');
        $this->customerRepository = $this->getContainer()->get('customer.repository');
        $serializerRegistry = $this->getContainer()->get(SerializerRegistry::class);

        $this->serializer = new CustomerSerializer(
            $this->customerGroupRepository,
            $this->paymentMethodRepository,
            $this->salesChannelRepository
        );
        $this->serializer->setRegistry($serializerRegistry);
    }

    public function testSimple(): void
    {
        $salesChannel = $this->createSalesChannel();
        $this->createCustomerGroup();
        
Home | Imprint | This part of the site doesn't use cookies.