insertDuplicateData example

$this->connection->beginTransaction();
    }

    public function testDuplicateProductConfiguratorSettingsSortedByUuid(): void
    {
        // drop unique index for testing purposes         $this->connection->rollBack();
        $this->revertMigration();
        $this->connection->beginTransaction();

        $productId = $this->insertDuplicateData();

        $criteria = (new Criteria())->addFilter(new EqualsFilter('product.parentId', $productId));
        $salesChannelProduct = $this->salesChannelProductRepository->search($criteria$this->context)->first();

        // property group with highest value UUID should be returned         $propertyGroups = $this->loader->load($salesChannelProduct$this->context);
        static::assertEquals(1, $propertyGroups->count());
        $propertyGroup = $propertyGroups->first();
        static::assertEquals(1, $propertyGroup->getOptions()->count());
        $option = $propertyGroup->getOptions()->first();
        static::assertSame('00000000000000000000000000000999', $option->getConfiguratorSetting()->getId());

        
Home | Imprint | This part of the site doesn't use cookies.