Skip to content

Commit f2088d9

Browse files
author
Vitaliy Boyko
committed
ENGCOM-20434: Removed url key validation for invisible products (revert tests)
1 parent 6a5776c commit f2088d9

File tree

3 files changed

+6
-28
lines changed

3 files changed

+6
-28
lines changed

dev/tests/integration/testsuite/Magento/CatalogSearch/_files/product_configurable_not_available.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
$productSku = array_shift($productsSku);
4444
$product->setTypeId(Type::TYPE_SIMPLE)
4545
->setAttributeSetId($attributeSetId)
46-
->setName('Configurable Option Not Available' . $option->getLabel())
46+
->setName('Configurable Option' . $option->getLabel())
4747
->setSku('simple_not_avalilable_' . $productSku)
4848
->setPrice(11)
4949
->setTestConfigurable($option->getValue())

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

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@
55
*/
66
namespace Magento\CatalogUrlRewrite\Observer;
77

8-
use Magento\Catalog\Api\ProductRepositoryInterface;
9-
use Magento\Catalog\Model\Product\Visibility;
108
use Magento\Store\Model\StoreManagerInterface;
11-
use Magento\UrlRewrite\Model\Exception\UrlAlreadyExistsException;
129
use Magento\UrlRewrite\Service\V1\Data\UrlRewrite;
10+
use Magento\CatalogUrlRewrite\Model\CategoryUrlRewriteGenerator;
1311

1412
/**
1513
* @magentoAppArea adminhtml
@@ -20,16 +18,12 @@ class ProductProcessUrlRewriteSavingObserverTest extends \PHPUnit\Framework\Test
2018
/** @var \Magento\Framework\ObjectManagerInterface */
2119
protected $objectManager;
2220

23-
/** @var ProductRepositoryInterface */
24-
private $productRepository;
25-
2621
/**
2722
* Set up
2823
*/
2924
protected function setUp()
3025
{
3126
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
32-
$this->productRepository = $this->objectManager->get(ProductRepositoryInterface::class);
3327
}
3428

3529
/**
@@ -142,8 +136,10 @@ public function testUrlKeyHasChangedInGlobalContext()
142136
*/
143137
public function testUrlKeyHasChangedInStoreviewContextWithPermanentRedirection()
144138
{
139+
/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository*/
140+
$productRepository = $this->objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class);
145141
/** @var \Magento\Catalog\Model\Product $product*/
146-
$product = $this->productRepository->get('product1');
142+
$product = $productRepository->get('product1');
147143

148144
/** @var StoreManagerInterface $storeManager */
149145
$storeManager = $this->objectManager->get(StoreManagerInterface::class);
@@ -238,22 +234,4 @@ public function testUrlKeyHasChangedInStoreviewContextWithoutPermanentRedirectio
238234
$this->assertContains($row, $actual);
239235
}
240236
}
241-
242-
/**
243-
* @magentoDataFixture Magento/CatalogUrlRewrite/_files/product_simple.php
244-
* @magentoDataFixture Magento/Catalog/_files/second_product_simple.php
245-
* @magentoAppIsolation enabled
246-
*/
247-
public function testDuplicatedUrlKeyInvisibleProduct()
248-
{
249-
$this->expectException(
250-
UrlAlreadyExistsException::class,
251-
'URL key for specified store already exists'
252-
);
253-
/** @var \Magento\Catalog\Model\Product $product*/
254-
$product = $this->productRepository->get('simple2');
255-
$product->setVisibility(Visibility::VISIBILITY_NOT_VISIBLE);
256-
$product->setUrlKey('simple_product');
257-
$product->save();
258-
}
259237
}

dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/configurable_products.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
->setId($productId)
108108
->setAttributeSetId($attributeSetId)
109109
->setWebsiteIds([1])
110-
->setName('Configurable Option 12345' . $option->getLabel())
110+
->setName('Configurable Option' . $option->getLabel())
111111
->setSku('simple_' . $productId)
112112
->setPrice($productId)
113113
->setTestConfigurable($option->getValue())

0 commit comments

Comments
 (0)