test url reassignment

This commit is contained in:
Etienne Roudeix
2013-12-11 13:07:02 +01:00
parent 02b9d2e509
commit 6acb1924d8

View File

@@ -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);
}
}