aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas.loeuillet@smile.fr>2015-10-07 18:08:51 +0200
committerNicolas LÅ“uillet <nicolas.loeuillet@smile.fr>2015-10-08 13:29:41 +0200
commit880a0e1c0ba7d0ab3320678b076402379a08c8a2 (patch)
tree2d3d53811a7988974543fc61c70e55ac70e9be5b /src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
parent3bfbd22f13e778c6b9713cde0cdf5b7b824f1ff2 (diff)
downloadwallabag-880a0e1c0ba7d0ab3320678b076402379a08c8a2.tar.gz
wallabag-880a0e1c0ba7d0ab3320678b076402379a08c8a2.tar.zst
wallabag-880a0e1c0ba7d0ab3320678b076402379a08c8a2.zip
implement bookmarklet
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php')
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
index 2862417e..5ac39d12 100644
--- a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
@@ -31,6 +31,31 @@ class EntryControllerTest extends WallabagCoreTestCase
31 $this->assertCount(1, $crawler->filter('button[type=submit]')); 31 $this->assertCount(1, $crawler->filter('button[type=submit]'));
32 } 32 }
33 33
34 public function testPostNewViaBookmarklet()
35 {
36 $this->logInAs('admin');
37 $client = $this->getClient();
38
39 $crawler = $client->request('GET', '/');
40
41 $this->assertCount(4, $crawler->filter('div[class=entry]'));
42
43 // Good URL
44 $crawler = $client->request('GET', '/bookmarklet', array('url' => $this->url));
45 $this->assertEquals(302, $client->getResponse()->getStatusCode());
46 $crawler = $client->followRedirect();
47 $crawler = $client->request('GET', '/');
48 $this->assertCount(5, $crawler->filter('div[class=entry]'));
49
50 $em = $client->getContainer()
51 ->get('doctrine.orm.entity_manager');
52 $entry = $em
53 ->getRepository('WallabagCoreBundle:Entry')
54 ->findOneByUrl($this->url);
55 $em->remove($entry);
56 $em->flush();
57 }
58
34 public function testPostNewEmpty() 59 public function testPostNewEmpty()
35 { 60 {
36 $this->logInAs('admin'); 61 $this->logInAs('admin');