DataValidator example

$definition->set('zipcode', new CustomerZipCode(['countryId' => null]));

                static::assertEquals($event->getDefinition()->getProperties()$definition->getProperties());
            }

            return $event;
        });

        $register = new RegisterRoute(
            $dispatcher,
            $this->createMock(NumberRangeValueGeneratorInterface::class),
            new DataValidator(Validation::createValidatorBuilder()->getValidator()),
            $this->createMock(DataValidationFactoryInterface::class),
            $addressValidation,
            $systemConfigService,
            $customerRepository,
            $this->createMock(SalesChannelContextPersister::class),
            $this->createMock(SalesChannelRepository::class),
            $this->createMock(Connection::class),
            $this->createMock(SalesChannelContextService::class),
            $this->createMock(StoreApiCustomFieldMapper::class),
            $this->createMock(EntityRepository::class),
        );

        
private OrderService $orderService;

    protected function setUp(): void
    {
        $eventDispatcher = $this->createMock(EventDispatcherInterface::class);
        $this->cartService = $this->createMock(CartService::class);
        $this->paymentMethodRepository = $this->createMock(EntityRepository::class);
        $stateMachineRegistry = $this->createMock(StateMachineRegistry::class);

        $this->orderService = new OrderService(
            new DataValidator(Validation::createValidatorBuilder()->getValidator()),
            new OrderValidationFactory(),
            $eventDispatcher,
            $this->cartService,
            $this->paymentMethodRepository,
            $stateMachineRegistry
        );
    }

    public function testCreateOrderWithDigitalGoodsNeedsRevocationConfirm(): void
    {
        $dataBag = new DataBag();
        
Home | Imprint | This part of the site doesn't use cookies.