aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2016-01-22 09:36:50 +0100
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2016-01-22 09:36:50 +0100
commit6c32aaae95caf6fcd6740fa1a78f8af31bb6370f (patch)
tree87a1f573e7b405f34588a91f87b9196810cdaa7a /src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
parent9aa66d6244935fe86a5598fbdbe518cf6204af2e (diff)
parent23afdf3a70a5035cb58b76138a8627701ba55273 (diff)
downloadwallabag-6c32aaae95caf6fcd6740fa1a78f8af31bb6370f.tar.gz
wallabag-6c32aaae95caf6fcd6740fa1a78f8af31bb6370f.tar.zst
wallabag-6c32aaae95caf6fcd6740fa1a78f8af31bb6370f.zip
Merge pull request #1614 from wallabag/v2-few-fixes
Few fixes
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php')
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php31
1 files changed, 28 insertions, 3 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
index 1d1620dc..32d6a575 100644
--- a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
@@ -127,10 +127,35 @@ class EntryControllerTest extends WallabagCoreTestCase
127 127
128 $this->assertEquals(302, $client->getResponse()->getStatusCode()); 128 $this->assertEquals(302, $client->getResponse()->getStatusCode());
129 129
130 $crawler = $client->followRedirect(); 130 $content = $client->getContainer()
131 ->get('doctrine.orm.entity_manager')
132 ->getRepository('WallabagCoreBundle:Entry')
133 ->findByUrlAndUserId($this->url, $this->getLoggedInUserId());
134
135 $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content);
136 $this->assertEquals($this->url, $content->getUrl());
137 $this->assertContains('Google', $content->getTitle());
138 }
139
140 public function testPostNewOkUrlExist()
141 {
142 $this->logInAs('admin');
143 $client = $this->getClient();
144
145 $crawler = $client->request('GET', '/new');
146
147 $this->assertEquals(200, $client->getResponse()->getStatusCode());
148
149 $form = $crawler->filter('button[type=submit]')->form();
150
151 $data = array(
152 'entry[url]' => $this->url,
153 );
131 154
132 $this->assertGreaterThan(1, $alert = $crawler->filter('h2 a')->extract(array('_text'))); 155 $client->submit($form, $data);
133 $this->assertContains('Google', $alert[0]); 156
157 $this->assertEquals(302, $client->getResponse()->getStatusCode());
158 $this->assertContains('/view/', $client->getResponse()->getTargetUrl());
134 } 159 }
135 160
136 /** 161 /**