forked from magento/magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Covered testNonExistentEntityUrlRewrite case
- Loading branch information
1 parent
273ea48
commit 43ba611
Showing
3 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...tests/integration/testsuite/Magento/UrlRewrite/_files/url_rewrite_not_existing_entity.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
use Magento\TestFramework\Helper\Bootstrap; | ||
use Magento\UrlRewrite\Model\UrlRewrite; | ||
|
||
$objectManager = Bootstrap::getObjectManager(); | ||
|
||
/** @var int Product Id */ | ||
$productId = 708579; | ||
|
||
/** @var UrlRewrite $urlRewrite */ | ||
$urlRewrite = $objectManager->create(UrlRewrite::class); | ||
$urlRewrite->setEntityType('custom') | ||
->setRequestPath('non-exist-entity.html') | ||
->setTargetPath('catalog/product/view/id/' . $productId) | ||
->setRedirectType(0) | ||
->setStoreId(1) | ||
->setDescription(null) | ||
->setIsAutogenerated(0); | ||
|
||
$urlRewrite->save(); |
15 changes: 15 additions & 0 deletions
15
...egration/testsuite/Magento/UrlRewrite/_files/url_rewrite_not_existing_entity_rollback.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
use Magento\TestFramework\Helper\Bootstrap; | ||
use Magento\UrlRewrite\Model\UrlRewrite; | ||
|
||
$objectManager = Bootstrap::getObjectManager(); | ||
|
||
/** @var UrlRewrite $urlRewrite */ | ||
$urlRewrite = $objectManager->create(UrlRewrite::class); | ||
$urlRewrite->load('non-exist-entity.html', 'request_path'); | ||
$urlRewrite->delete(); |