/** * @expectedException \Thelia\Form\Exception\FormValidationException * @expectedExceptionCode 100 */ public function testUpdateExistingUrl() { $object = null; $event = $this->getUpdateSeoEvent($object); /* get an existing url */ $existingUrl = RewritingUrlQuery::create()->filterByViewId($object->getId(), Criteria::NOT_EQUAL)->filterByRedirected(null)->filterByView(ConfigQuery::getObsoleteRewrittenUrlView(), Criteria::NOT_EQUAL)->findOne(); if (null === $existingUrl) { $this->fail('use fixtures before launching test, there is not enough rewritten url'); } $event->setUrl($existingUrl->getUrl()); $this->processUpdateSeoAction($event); }
/** * Mark the current URL as obseolete */ public function markRewrittenUrlObsolete() { RewritingUrlQuery::create()->filterByView($this->getRewrittenUrlViewName())->filterByViewId($this->getId())->update(array("View" => ConfigQuery::getObsoleteRewrittenUrlView())); }