DocumentEntity example

/** * @dataProvider getMatchingValues * * @param list<string> $selectedDocumentIds */
    public function testOrderDocumentTypeRuleMatching(bool $expected, string|null $documentId, array $selectedDocumentIds, string $operator): void
    {
        $order = new OrderEntity();
        $collection = new DocumentCollection();

        if ($documentId) {
            $document = new DocumentEntity();
            $document->setId(Uuid::randomHex());
            $document->setDocumentTypeId($documentId);
            $collection->add($document);
        }

        $order->setDocuments($collection);
        $cart = Generator::createCart();
        $context = Generator::createSalesChannelContext();
        $scope = new FlowRuleScope($order$cart$context);

        $this->rule->assign(['documentIds' => $selectedDocumentIds, 'operator' => $operator]);
        
Home | Imprint | This part of the site doesn't use cookies.