aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2016-01-15 15:28:22 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-01-15 15:28:32 +0100
commit78833672469f7beb0c4a195aa0a76f7ca4133057 (patch)
tree87e295afbfc22e94262f3c498ce758a1101c939e /src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
parent790573d45899504bdecd2573c8f64018e23b139e (diff)
downloadwallabag-78833672469f7beb0c4a195aa0a76f7ca4133057.tar.gz
wallabag-78833672469f7beb0c4a195aa0a76f7ca4133057.tar.zst
wallabag-78833672469f7beb0c4a195aa0a76f7ca4133057.zip
Fix `findOneByUrl` side effect in tests
Fix #1566
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php')
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
index 3a775182..1d1620dc 100644
--- a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
@@ -38,7 +38,7 @@ class EntryControllerTest extends WallabagCoreTestCase
38 $form = $crawler->filter('button[type=submit]')->form(); 38 $form = $crawler->filter('button[type=submit]')->form();
39 39
40 $data = array( 40 $data = array(
41 'entry[url]' => 'https://www.wallabag.org/blog/2016/01/08/wallabag-alpha1-v2', 41 'entry[url]' => $this->url,
42 ); 42 );
43 43
44 $client->submit($form, $data); 44 $client->submit($form, $data);
@@ -82,7 +82,7 @@ class EntryControllerTest extends WallabagCoreTestCase
82 ->get('doctrine.orm.entity_manager'); 82 ->get('doctrine.orm.entity_manager');
83 $entry = $em 83 $entry = $em
84 ->getRepository('WallabagCoreBundle:Entry') 84 ->getRepository('WallabagCoreBundle:Entry')
85 ->findOneByUrl($this->url); 85 ->findByUrlAndUserId($this->url, $this->getLoggedInUserId());
86 $em->remove($entry); 86 $em->remove($entry);
87 $em->flush(); 87 $em->flush();
88 } 88 }
@@ -202,7 +202,7 @@ class EntryControllerTest extends WallabagCoreTestCase
202 $content = $client->getContainer() 202 $content = $client->getContainer()
203 ->get('doctrine.orm.entity_manager') 203 ->get('doctrine.orm.entity_manager')
204 ->getRepository('WallabagCoreBundle:Entry') 204 ->getRepository('WallabagCoreBundle:Entry')
205 ->findOneByUrl($this->url); 205 ->findByUrlAndUserId($this->url, $this->getLoggedInUserId());
206 206
207 $client->request('GET', '/view/'.$content->getId()); 207 $client->request('GET', '/view/'.$content->getId());
208 208
@@ -223,7 +223,7 @@ class EntryControllerTest extends WallabagCoreTestCase
223 $content = $client->getContainer() 223 $content = $client->getContainer()
224 ->get('doctrine.orm.entity_manager') 224 ->get('doctrine.orm.entity_manager')
225 ->getRepository('WallabagCoreBundle:Entry') 225 ->getRepository('WallabagCoreBundle:Entry')
226 ->findOneByUrl($this->url); 226 ->findByUrlAndUserId($this->url, $this->getLoggedInUserId());
227 227
228 // empty content 228 // empty content
229 $content->setContent(''); 229 $content->setContent('');
@@ -237,7 +237,7 @@ class EntryControllerTest extends WallabagCoreTestCase
237 $content = $client->getContainer() 237 $content = $client->getContainer()
238 ->get('doctrine.orm.entity_manager') 238 ->get('doctrine.orm.entity_manager')
239 ->getRepository('WallabagCoreBundle:Entry') 239 ->getRepository('WallabagCoreBundle:Entry')
240 ->findOneByUrl($this->url); 240 ->findByUrlAndUserId($this->url, $this->getLoggedInUserId());
241 241
242 $this->assertNotEmpty($content->getContent()); 242 $this->assertNotEmpty($content->getContent());
243 } 243 }
@@ -250,7 +250,7 @@ class EntryControllerTest extends WallabagCoreTestCase
250 $content = $client->getContainer() 250 $content = $client->getContainer()
251 ->get('doctrine.orm.entity_manager') 251 ->get('doctrine.orm.entity_manager')
252 ->getRepository('WallabagCoreBundle:Entry') 252 ->getRepository('WallabagCoreBundle:Entry')
253 ->findOneByUrl($this->url); 253 ->findByUrlAndUserId($this->url, $this->getLoggedInUserId());
254 254
255 $crawler = $client->request('GET', '/edit/'.$content->getId()); 255 $crawler = $client->request('GET', '/edit/'.$content->getId());
256 256
@@ -268,7 +268,7 @@ class EntryControllerTest extends WallabagCoreTestCase
268 $content = $client->getContainer() 268 $content = $client->getContainer()
269 ->get('doctrine.orm.entity_manager') 269 ->get('doctrine.orm.entity_manager')
270 ->getRepository('WallabagCoreBundle:Entry') 270 ->getRepository('WallabagCoreBundle:Entry')
271 ->findOneByUrl($this->url); 271 ->findByUrlAndUserId($this->url, $this->getLoggedInUserId());
272 272
273 $crawler = $client->request('GET', '/edit/'.$content->getId()); 273 $crawler = $client->request('GET', '/edit/'.$content->getId());
274 274
@@ -298,7 +298,7 @@ class EntryControllerTest extends WallabagCoreTestCase
298 $content = $client->getContainer() 298 $content = $client->getContainer()
299 ->get('doctrine.orm.entity_manager') 299 ->get('doctrine.orm.entity_manager')
300 ->getRepository('WallabagCoreBundle:Entry') 300 ->getRepository('WallabagCoreBundle:Entry')
301 ->findOneByUrl($this->url); 301 ->findByUrlAndUserId($this->url, $this->getLoggedInUserId());
302 302
303 $client->request('GET', '/archive/'.$content->getId()); 303 $client->request('GET', '/archive/'.$content->getId());
304 304
@@ -320,7 +320,7 @@ class EntryControllerTest extends WallabagCoreTestCase
320 $content = $client->getContainer() 320 $content = $client->getContainer()
321 ->get('doctrine.orm.entity_manager') 321 ->get('doctrine.orm.entity_manager')
322 ->getRepository('WallabagCoreBundle:Entry') 322 ->getRepository('WallabagCoreBundle:Entry')
323 ->findOneByUrl($this->url); 323 ->findByUrlAndUserId($this->url, $this->getLoggedInUserId());
324 324
325 $client->request('GET', '/star/'.$content->getId()); 325 $client->request('GET', '/star/'.$content->getId());
326 326
@@ -342,7 +342,7 @@ class EntryControllerTest extends WallabagCoreTestCase
342 $content = $client->getContainer() 342 $content = $client->getContainer()
343 ->get('doctrine.orm.entity_manager') 343 ->get('doctrine.orm.entity_manager')
344 ->getRepository('WallabagCoreBundle:Entry') 344 ->getRepository('WallabagCoreBundle:Entry')
345 ->findOneByUrl($this->url); 345 ->findByUrlAndUserId($this->url, $this->getLoggedInUserId());
346 346
347 $client->request('GET', '/delete/'.$content->getId()); 347 $client->request('GET', '/delete/'.$content->getId());
348 348