Skip to content

Commit bcbcd9e

Browse files
committed
ACP2E-3900: Update product url_key via REST API does not generate a 301 URL Rewrite
- fixed tests
1 parent 9573503 commit bcbcd9e

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/ProductUrlRewriteTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ public function testProductUrlRewritePerStoreViews(): void
278278
$product
279279
);
280280
$urlRewriteItems = $this->getEntityRewriteCollection($product->getId())->getItems();
281-
$this->assertTrue(count($urlRewriteItems) == 2);
281+
$this->assertTrue(count($urlRewriteItems) == 3);
282282
foreach ($urlRewriteItems as $item) {
283283
$item->getData('store_id') == $secondStoreId
284284
? $this->assertEquals($urlKeySecondStore . $this->suffix, $item->getRequestPath())

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,17 @@ function (UrlRewrite $urlRewrite) {
119119
$generatedUrls
120120
)
121121
);
122+
sort($actual);
122123

123124
$expected = [
124-
'store-1-key.html', // the Default store
125-
'store-1-key.html', // the Secondary store
125+
'cat-1-2/p002.html', // the Secondary store with Category URL key, first store view
126+
'cat-1-2/p002.html', // the Secondary store with Category URL key, second store view
126127
'cat-1/store-1-key.html', // the Default store with Category URL key, first store view
127128
'cat-1/store-1-key.html', // the Default store with Category URL key, second store view
128-
'p002.html', // the Default store
129129
'p002.html', // the Secondary store
130-
'cat-1-2/p002.html', // the Secondary store with Category URL key, first store view
131-
'cat-1-2/p002.html', // the Secondary store with Category URL key, second store view
130+
'p002.html', // the Default store
131+
'store-1-key.html', // the Default store
132+
'store-1-key.html', // the Secondary store
132133
];
133134
self::assertEquals($expected, $actual, 'Generated URLs rewrites do not match.');
134135
}

0 commit comments

Comments
 (0)