aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
diff options
context:
space:
mode:
authorJeremy Benoist <j0k3r@users.noreply.github.com>2015-12-06 14:31:26 +0100
committerJeremy Benoist <j0k3r@users.noreply.github.com>2015-12-06 14:31:26 +0100
commita7f1921f7db312b5def3839393357f443dcbb52c (patch)
tree0522e03891433e9fdc9eb64d52b2d9651aadf1f7 /src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
parent2e15e30bf0e634bbbc3a9678904953d015490ed2 (diff)
parent752b90d1f2e279d3662d5431b09c7587df2937ca (diff)
downloadwallabag-a7f1921f7db312b5def3839393357f443dcbb52c.tar.gz
wallabag-a7f1921f7db312b5def3839393357f443dcbb52c.tar.zst
wallabag-a7f1921f7db312b5def3839393357f443dcbb52c.zip
Merge pull request #1478 from K-Phoen/rule-based-tags
Rule based tags
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php')
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
index 56b4c9e4..af62aee8 100644
--- a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
@@ -102,6 +102,44 @@ 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 $tags = $entry->getTags();
135
136 $this->assertCount(1, $tags);
137 $this->assertEquals('wallabag', $tags[0]->getLabel());
138
139 $em->remove($entry);
140 $em->flush();
141 }
142
105 public function testArchive() 143 public function testArchive()
106 { 144 {
107 $this->logInAs('admin'); 145 $this->logInAs('admin');