X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FTests%2FController%2FEntryControllerTest.php;h=5ac39d1212276a210ba3b6471d6ee815aa41ff26;hb=735068d1814a4b7a688e1d19cd17b13e8c5da3eb;hp=2862417e304627dc7dc690183484f54d370d76f5;hpb=cfb28c9da0ff648d34ae0602eaec55a8362504dd;p=github%2Fwallabag%2Fwallabag.git 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 $this->assertCount(1, $crawler->filter('button[type=submit]')); } + public function testPostNewViaBookmarklet() + { + $this->logInAs('admin'); + $client = $this->getClient(); + + $crawler = $client->request('GET', '/'); + + $this->assertCount(4, $crawler->filter('div[class=entry]')); + + // Good URL + $crawler = $client->request('GET', '/bookmarklet', array('url' => $this->url)); + $this->assertEquals(302, $client->getResponse()->getStatusCode()); + $crawler = $client->followRedirect(); + $crawler = $client->request('GET', '/'); + $this->assertCount(5, $crawler->filter('div[class=entry]')); + + $em = $client->getContainer() + ->get('doctrine.orm.entity_manager'); + $entry = $em + ->getRepository('WallabagCoreBundle:Entry') + ->findOneByUrl($this->url); + $em->remove($entry); + $em->flush(); + } + public function testPostNewEmpty() { $this->logInAs('admin');