Ensure retrieved data are fresh

This commit is contained in:
Jeremy Benoist 2017-05-31 11:11:02 +02:00
parent 5dbf3f2326
commit 31485bddb9
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C

View file

@ -134,6 +134,12 @@ class TagControllerTest extends WallabagCoreTestCase
$this->assertEquals(302, $client->getResponse()->getStatusCode());
$this->assertEquals($entryUri, $client->getResponse()->getTargetUrl());
// re-retrieve the entry to be sure to get fresh data from database (mostly for tags)
$entry = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->findByUrlAndUserId('http://0.0.0.0/entry1', $this->getLoggedInUserId());
$this->assertNotContains($this->tagName, $entry->getTags());
$client->request('GET', '/remove-tag/'.$entry->getId().'/'.$tag->getId());