aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
diff options
context:
space:
mode:
authorKévin Gomez <contact@kevingomez.fr>2015-11-13 21:23:39 +0100
committerKévin Gomez <contact@kevingomez.fr>2015-11-13 22:53:28 +0100
commit958671a7ae2f19c4b919ed4ba0161e7d300411b4 (patch)
treeec1c31c0c8dd8638c961f12a37e7fa58732c063b /src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
parentaeff8aa765579259c1427dc469ff78ebdebfc72c (diff)
downloadwallabag-958671a7ae2f19c4b919ed4ba0161e7d300411b4.tar.gz
wallabag-958671a7ae2f19c4b919ed4ba0161e7d300411b4.tar.zst
wallabag-958671a7ae2f19c4b919ed4ba0161e7d300411b4.zip
Add a quick test
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php')
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
index 56b4c9e4..9f2bcd6c 100644
--- a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
@@ -102,6 +102,41 @@ class EntryControllerTest extends WallabagCoreTestCase
102 $this->assertContains('Google', $alert[0]); 102 $this->assertContains('Google', $alert[0]);
103 } 103 }
104 104
105 /**
106 * This test will require an internet connection.
107 */
108 public function testPostNewThatWillBeTaggued()
109 {
110 $this->logInAs('admin');
111 $client = $this->getClient();
112
113 $crawler = $client->request('GET', '/new');
114
115 $this->assertEquals(200, $client->getResponse()->getStatusCode());
116
117 $form = $crawler->filter('button[type=submit]')->form();
118
119 $data = array(
120 'entry[url]' => $url = 'https://github.com/wallabag/wallabag',
121 );
122
123 $client->submit($form, $data);
124
125 $this->assertEquals(302, $client->getResponse()->getStatusCode());
126
127 $crawler = $client->followRedirect();
128
129 $em = $client->getContainer()
130 ->get('doctrine.orm.entity_manager');
131 $entry = $em
132 ->getRepository('WallabagCoreBundle:Entry')
133 ->findOneByUrl($url);
134 $this->assertCount(1, $entry->getTags());
135
136 $em->remove($entry);
137 $em->flush();
138 }
139
105 public function testArchive() 140 public function testArchive()
106 { 141 {
107 $this->logInAs('admin'); 142 $this->logInAs('admin');