aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-06-08 16:35:41 +0200
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2015-06-08 16:35:41 +0200
commit9b9b05008a96a45bbf6da4c0c1c1b1244b83c6af (patch)
tree8b73ad50783cf8066ec4171367e2dd1e26026636 /src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
parent3cf22a05416b9994aa458ea045d232264006e7cf (diff)
parentac9d58211e1c6676485ef15d023215e5a465f3a8 (diff)
downloadwallabag-9b9b05008a96a45bbf6da4c0c1c1b1244b83c6af.tar.gz
wallabag-9b9b05008a96a45bbf6da4c0c1c1b1244b83c6af.tar.zst
wallabag-9b9b05008a96a45bbf6da4c0c1c1b1244b83c6af.zip
Merge branch 'v2-edit-title' into v2
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php')
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
index 8a7fdda2..904e2a5c 100644
--- a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
@@ -109,6 +109,54 @@ class EntryControllerTest extends WallabagCoreTestCase
109 $this->assertContains($content->getTitle(), $client->getResponse()->getContent()); 109 $this->assertContains($content->getTitle(), $client->getResponse()->getContent());
110 } 110 }
111 111
112 public function testEdit()
113 {
114 $this->logInAs('admin');
115 $client = $this->getClient();
116
117 $content = $client->getContainer()
118 ->get('doctrine.orm.entity_manager')
119 ->getRepository('WallabagCoreBundle:Entry')
120 ->findOneByIsArchived(false);
121
122 $crawler = $client->request('GET', '/edit/'.$content->getId());
123
124 $this->assertEquals(200, $client->getResponse()->getStatusCode());
125
126 $this->assertCount(1, $crawler->filter('input[id=entry_title]'));
127 $this->assertCount(1, $crawler->filter('button[id=entry_save]'));
128 }
129
130 public function testEditUpdate()
131 {
132 $this->logInAs('admin');
133 $client = $this->getClient();
134
135 $content = $client->getContainer()
136 ->get('doctrine.orm.entity_manager')
137 ->getRepository('WallabagCoreBundle:Entry')
138 ->findOneByIsArchived(false);
139
140 $crawler = $client->request('GET', '/edit/'.$content->getId());
141
142 $this->assertEquals(200, $client->getResponse()->getStatusCode());
143
144 $form = $crawler->filter('button[type=submit]')->form();
145
146 $data = array(
147 'entry[title]' => 'My updated title hehe :)',
148 );
149
150 $client->submit($form, $data);
151
152 $this->assertEquals(302, $client->getResponse()->getStatusCode());
153
154 $crawler = $client->followRedirect();
155
156 $this->assertGreaterThan(1, $alert = $crawler->filter('div[id=article] h1')->extract(array('_text')));
157 $this->assertContains('My updated title hehe :)', $alert[0]);
158 }
159
112 public function testToggleArchive() 160 public function testToggleArchive()
113 { 161 {
114 $this->logInAs('admin'); 162 $this->logInAs('admin');