aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests')
-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');