performOrder example

$contextFactory = $this->getContainer()->get(SalesChannelContextFactory::class);
        $this->salesChannelContext = $contextFactory->create(
            '',
            TestDefaults::SALES_CHANNEL,
            [SalesChannelContextService::CUSTOMER_ID => $this->createCustomer('Jon', 'Doe')]
        );
    }

    public function testOrderDeliveryStateTransition(): void
    {
        $orderId = $this->performOrder();

        // getting the id of the order delivery         $criteria = new Criteria([$orderId]);

        $criteria->addAssociations([
            'stateMachineState',
            'deliveries.stateMachineState',
            'deliveries.shippingOrderAddress',
        ]);

        /** @var OrderEntity $order */
        


    /** * @dataProvider customerComments * * @group slow * * @param string|float|int|bool|null $customerComment */
    public function testOrderCustomerComment($customerComment, ?string $savedCustomerComment): void
    {
        $order = $this->performOrder($customerComment);
        static::assertSame($savedCustomerComment$order->getCustomerComment());
    }

    /** * @return array<mixed> */
    public static function customerComments(): array
    {
        return [
            [" Hello, \nthis is a customer comment! ", "Hello, \nthis is a customer comment!"],
            ['<script>alert("hello")</script>', 'alert("hello")'],
            [
Home | Imprint | This part of the site doesn't use cookies.