create test rewritten url for category

This commit is contained in:
Manuel Raynaud
2013-09-18 12:24:36 +02:00
parent 4eaf7288ba
commit fd74703658
3 changed files with 114 additions and 9 deletions

View File

@@ -61,7 +61,11 @@ trait UrlRewritingTrait {
$this->setLocale($locale);
$title = $this->getTitle() ?: $this->getRef();
$title = $this->getTitle();
if(null == $title) {
throw new \RuntimeException('Impossible to create an url if title is null');
}
// Replace all weird characters with dashes
$string = preg_replace('/[^\w\-~_\.]+/u', '-', $title);