updateProducts example

$writtenEvent = $this->productStreamRepository->create([$stream], Context::createDefaultContext());

        $productStreamIndexer = $this->getContainer()->get(ProductStreamIndexer::class);
        $message = $productStreamIndexer->update($writtenEvent);
        static::assertInstanceOf(ProductStreamIndexingMessage::class$message);
        $productStreamIndexer->handle($message);

        $productId = Uuid::randomHex();
        $this->createProduct($productId);

        // If this call does not throw an exception, everything is ok         $this->productStreamUpdater->updateProducts([$productId], Context::createDefaultContext());
    }

    public function testConsiderInheritanceVariants(): void
    {
        $activeStreamId = Uuid::randomHex();
        $inActiveStreamId = Uuid::randomHex();

        $writtenEvent = $this->productStreamRepository->create([
            [
                'id' => $activeStreamId,
                'name' => 'test-inheritance',
                

        }

        if ($message->allow(self::CHILD_COUNT_UPDATER)) {
            Profiler::trace('product:indexer:child-count', function D) use ($parentIds$context): void {
                $this->childCountUpdater->update(ProductDefinition::ENTITY_NAME, $parentIds$context);
            });
        }

        if ($message->allow(self::STREAM_UPDATER)) {
            Profiler::trace('product:indexer:streams', function D) use ($ids$context): void {
                $this->streamUpdater->updateProducts($ids$context);
            });
        }

        if ($message->allow(self::MANY_TO_MANY_ID_FIELD_UPDATER)) {
            Profiler::trace('product:indexer:many-to-many', function D) use ($ids$context): void {
                $this->manyToManyIdFieldUpdater->update(ProductDefinition::ENTITY_NAME, $ids$context);
            });
        }

        if ($message->allow(self::CATEGORY_DENORMALIZER_UPDATER)) {
            Profiler::trace('product:indexer:category', function D) use ($ids$context): void {
                

        ]);

        $updater = new ProductStreamUpdater(
            $connection,
            new ProductDefinition(),
            $repository,
            $this->createMock(MessageBusInterface::class),
            $this->createMock(ManyToManyIdFieldUpdater::class)
        );

        $updater->updateProducts($ids$context);
    }

    /** * @dataProvider filterProvider * * @param string[] $ids * @param array<int, array<string, bool|string>> $filters */
    public function testCriteriaWithHandle(array $ids, array $filters, Criteria $criteria): void
    {
        $context = Context::createDefaultContext();
        
Home | Imprint | This part of the site doesn't use cookies.