diff --git a/core/lib/Thelia/Tests/Action/RewrittenUrlTestTrait.php b/core/lib/Thelia/Tests/Action/RewrittenUrlTestTrait.php index 567fbe3d9..46f28d7f5 100644 --- a/core/lib/Thelia/Tests/Action/RewrittenUrlTestTrait.php +++ b/core/lib/Thelia/Tests/Action/RewrittenUrlTestTrait.php @@ -5,6 +5,7 @@ use Propel\Runtime\ActiveQuery\Criteria; use Thelia\Exception\UrlRewritingException; use Thelia\Model\Base\RewritingUrlQuery; use Thelia\Model\ConfigQuery; +use Thelia\Model\ProductQuery; use Thelia\Rewriting\RewritingResolver; use Thelia\Tools\URL; @@ -81,6 +82,17 @@ trait RewrittenUrlTestTrait $this->assertEquals($oldUrlEntry->getRedirected(), $newUrlEntry->getId()); /* we can reassign old Url to another object */ - //@todo + $aRandomProduct = ProductQuery::create() + ->filterById($object->getId(), Criteria::NOT_EQUAL) + ->findOne(); + + $failReassign = true; + try { + $aRandomProduct->setRewrittenUrl($aRandomProduct->getLocale(), $currentUrl); + $failReassign = false; + } catch(\Exception $e) { + } + + $this->assertFalse($failReassign); } } \ No newline at end of file