test url reassignment
This commit is contained in:
@@ -5,6 +5,7 @@ use Propel\Runtime\ActiveQuery\Criteria;
|
|||||||
use Thelia\Exception\UrlRewritingException;
|
use Thelia\Exception\UrlRewritingException;
|
||||||
use Thelia\Model\Base\RewritingUrlQuery;
|
use Thelia\Model\Base\RewritingUrlQuery;
|
||||||
use Thelia\Model\ConfigQuery;
|
use Thelia\Model\ConfigQuery;
|
||||||
|
use Thelia\Model\ProductQuery;
|
||||||
use Thelia\Rewriting\RewritingResolver;
|
use Thelia\Rewriting\RewritingResolver;
|
||||||
use Thelia\Tools\URL;
|
use Thelia\Tools\URL;
|
||||||
|
|
||||||
@@ -81,6 +82,17 @@ trait RewrittenUrlTestTrait
|
|||||||
$this->assertEquals($oldUrlEntry->getRedirected(), $newUrlEntry->getId());
|
$this->assertEquals($oldUrlEntry->getRedirected(), $newUrlEntry->getId());
|
||||||
|
|
||||||
/* we can reassign old Url to another object */
|
/* 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user