forked from wallabag/wallabag
TagRestController: fix test for tag without entries
As the deletion now requires that at least one entry for the user must be linked to the given tag, we fix the test testDeleteUserTag by linking it to an entry. Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
This commit is contained in:
@ -32,12 +32,22 @@ class TagRestControllerTest extends WallabagApiTestCase
|
|||||||
|
|
||||||
public function testDeleteUserTag()
|
public function testDeleteUserTag()
|
||||||
{
|
{
|
||||||
|
$em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
|
||||||
|
$entry = $this->client->getContainer()
|
||||||
|
->get('doctrine.orm.entity_manager')
|
||||||
|
->getRepository('WallabagCoreBundle:Entry')
|
||||||
|
->findOneWithTags($this->user->getId());
|
||||||
|
|
||||||
|
$entry = $entry[0];
|
||||||
|
|
||||||
$tagLabel = 'tagtest';
|
$tagLabel = 'tagtest';
|
||||||
$tag = new Tag();
|
$tag = new Tag();
|
||||||
$tag->setLabel($tagLabel);
|
$tag->setLabel($tagLabel);
|
||||||
|
|
||||||
$em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
|
|
||||||
$em->persist($tag);
|
$em->persist($tag);
|
||||||
|
|
||||||
|
$entry->addTag($tag);
|
||||||
|
|
||||||
|
$em->persist($entry);
|
||||||
$em->flush();
|
$em->flush();
|
||||||
$em->clear();
|
$em->clear();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user