- $entry = $client->getContainer()
- ->get('doctrine.orm.entity_manager')
- ->getRepository('WallabagCoreBundle:Entry')
- ->findByUrlAndUserId('http://0.0.0.0/entry1', $this->getLoggedInUserId());
-
- $tag = $client->getContainer()
- ->get('doctrine.orm.entity_manager')
- ->getRepository('WallabagCoreBundle:Tag')
- ->findOneByEntryAndTagLabel($entry, $this->tagName);
-
+ $tag = new Tag();
+ $tag->setLabel($this->tagName);
+ $entry = new Entry($this->getLoggedInUser());
+ $entry->setUrl('http://0.0.0.0/foo');
+ $entry->addTag($tag);
+ $this->getEntityManager()->persist($entry);
+ $this->getEntityManager()->flush();
+ $this->getEntityManager()->clear();
+
+ // We make a first request to set an history and test redirection after tag deletion
+ $client->request('GET', '/view/'.$entry->getId());
+ $entryUri = $client->getRequest()->getUri();