Skip to content

Commit fdd2518

Browse files
committed
BUG#AC-2567: Removing a product from all websites in admin causes an SQLSTATE[42000]: Syntax error or access violation-issue fixed
1 parent 0b529ff commit fdd2518

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserverTest.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,14 @@
88
use Magento\Catalog\Api\ProductRepositoryInterface;
99
use Magento\Catalog\Model\Product;
1010
use Magento\Catalog\Model\Product\Visibility;
11+
use Magento\Catalog\Test\Fixture\Product as ProductFixture;
1112
use Magento\Framework\ObjectManagerInterface;
1213
use Magento\Store\Model\Store;
1314
use Magento\Store\Model\StoreManagerInterface;
15+
use Magento\Store\Test\Fixture\Group as GroupFixture;
16+
use Magento\Store\Test\Fixture\Store as StoreFixture;
17+
use Magento\Store\Test\Fixture\Website as WebsiteFixture;
18+
use Magento\TestFramework\Fixture\DataFixture;
1419
use Magento\TestFramework\Fixture\DataFixtureStorage;
1520
use Magento\TestFramework\Fixture\DataFixtureStorageManager;
1621
use Magento\TestFramework\Helper\Bootstrap;
@@ -641,14 +646,12 @@ public function testChangeVisibilityLocalScope()
641646
}
642647
}
643648

644-
/**
645-
* phpcs:disable Generic.Files.LineLength.TooLong
646-
* @magentoDataFixture Magento\Store\Test\Fixture\Website as:website
647-
* @magentoDataFixture Magento\Store\Test\Fixture\Group with:{"website_id":"$website.id$"} as:store_group
648-
* @magentoDataFixture Magento\Store\Test\Fixture\Store with:{"store_group_id":"$store_group.id$"} as:store
649-
* @magentoDataFixture Magento\Catalog\Test\Fixture\Product with:{"sku":"simple1","website_ids":[1,"$website.id$"]} as:product
650-
* @magentoAppIsolation enabled
651-
*/
649+
#[
650+
DataFixture(WebsiteFixture::class, as: 'website'),
651+
DataFixture(GroupFixture::class, ['website_id' => '$website.id$'], 'store_group'),
652+
DataFixture(StoreFixture::class, ['store_group_id' => '$store_group.id$'], 'store'),
653+
DataFixture(ProductFixture::class, ['sku' => 'simple1', 'website_ids' => [1,'$website.id$'], 'product']),
654+
]
652655
public function testRemoveProductFromAllWebsites(): void
653656
{
654657
$testStore1 = $this->storeManager->getStore('default');

0 commit comments

Comments
 (0)