Skip to content

Commit

Permalink
#29174 Add API functional test for redirect generation for category u…
Browse files Browse the repository at this point in the history
…pdates
  • Loading branch information
amenk committed Jul 21, 2020
1 parent f0ba72a commit 0f983b2
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ public function testUpdateUrlKey()
$result = $this->updateCategory($categoryId, $categoryData);
$this->assertEquals($categoryId, $result['id']);


$categoryData = [
'name' => 'Update Category Test New Name',
'custom_attributes' => [
Expand All @@ -256,9 +255,8 @@ public function testUpdateUrlKey()
$model = Bootstrap::getObjectManager()->get(\Magento\Catalog\Model\Category::class);
$category = $model->load($categoryId);
$this->assertEquals("Update Category Test New Name", $category->getName());
// delete category to clean up auto-generated url rewrites


// check for the url rewrite for the new name
$storage = Bootstrap::getObjectManager()->get(\Magento\UrlRewrite\Model\Storage\DbStorage::class);
$data = [
UrlRewrite::ENTITY_ID => $categoryId,
Expand All @@ -276,7 +274,7 @@ public function testUpdateUrlKey()
$this->assertEquals('update-category-test-new-name.html', $urlRewrite->getRequestPath());


// check for the forward
// check for the forward from the old name to the new name
$storage = Bootstrap::getObjectManager()->get(\Magento\UrlRewrite\Model\Storage\DbStorage::class);
$data = [
UrlRewrite::ENTITY_ID => $categoryId,
Expand Down

0 comments on commit 0f983b2

Please sign in to comment.