diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index 0e7e1576..cd63c1ba 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php | |||
@@ -265,6 +265,41 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
265 | $this->assertContains('/view/', $client->getResponse()->getTargetUrl()); | 265 | $this->assertContains('/view/', $client->getResponse()->getTargetUrl()); |
266 | } | 266 | } |
267 | 267 | ||
268 | public function testPostNewOkUrlExistWithRedirection() | ||
269 | { | ||
270 | $this->logInAs('admin'); | ||
271 | $client = $this->getClient(); | ||
272 | |||
273 | $url = 'https://fashionunited.com/news/business/jigsaw-posts-8-percent-increase-in-annual-sales/2017070316404'; | ||
274 | |||
275 | $crawler = $client->request('GET', '/new'); | ||
276 | |||
277 | $this->assertSame(200, $client->getResponse()->getStatusCode()); | ||
278 | |||
279 | $form = $crawler->filter('form[name=entry]')->form(); | ||
280 | |||
281 | $data = [ | ||
282 | 'entry[url]' => $url, | ||
283 | ]; | ||
284 | |||
285 | $client->submit($form, $data); | ||
286 | |||
287 | $crawler = $client->request('GET', '/new'); | ||
288 | |||
289 | $this->assertSame(200, $client->getResponse()->getStatusCode()); | ||
290 | |||
291 | $form = $crawler->filter('form[name=entry]')->form(); | ||
292 | |||
293 | $data = [ | ||
294 | 'entry[url]' => $url, | ||
295 | ]; | ||
296 | |||
297 | $client->submit($form, $data); | ||
298 | |||
299 | $this->assertSame(302, $client->getResponse()->getStatusCode()); | ||
300 | $this->assertContains('/view/', $client->getResponse()->getTargetUrl()); | ||
301 | } | ||
302 | |||
268 | /** | 303 | /** |
269 | * This test will require an internet connection. | 304 | * This test will require an internet connection. |
270 | */ | 305 | */ |