diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index 9dee9891..e9c12c49 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php | |||
@@ -166,7 +166,6 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
166 | $this->assertSame($this->url, $content->getUrl()); | 166 | $this->assertSame($this->url, $content->getUrl()); |
167 | $this->assertContains('Google', $content->getTitle()); | 167 | $this->assertContains('Google', $content->getTitle()); |
168 | $this->assertSame('fr', $content->getLanguage()); | 168 | $this->assertSame('fr', $content->getLanguage()); |
169 | $this->assertSame('2015-03-28 11:43:19', $content->getPublishedAt()->format('Y-m-d H:i:s')); | ||
170 | $this->assertArrayHasKey('x-frame-options', $content->getHeaders()); | 169 | $this->assertArrayHasKey('x-frame-options', $content->getHeaders()); |
171 | $client->getContainer()->get('craue_config')->set('store_article_headers', 0); | 170 | $client->getContainer()->get('craue_config')->set('store_article_headers', 0); |
172 | } | 171 | } |
@@ -269,6 +268,44 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
269 | /** | 268 | /** |
270 | * This test will require an internet connection. | 269 | * This test will require an internet connection. |
271 | */ | 270 | */ |
271 | public function testPostNewOkUrlExistWithRedirection() | ||
272 | { | ||
273 | $this->logInAs('admin'); | ||
274 | $client = $this->getClient(); | ||
275 | |||
276 | $url = 'https://wllbg.org/test-redirect/c51c'; | ||
277 | |||
278 | $crawler = $client->request('GET', '/new'); | ||
279 | |||
280 | $this->assertSame(200, $client->getResponse()->getStatusCode()); | ||
281 | |||
282 | $form = $crawler->filter('form[name=entry]')->form(); | ||
283 | |||
284 | $data = [ | ||
285 | 'entry[url]' => $url, | ||
286 | ]; | ||
287 | |||
288 | $client->submit($form, $data); | ||
289 | |||
290 | $crawler = $client->request('GET', '/new'); | ||
291 | |||
292 | $this->assertSame(200, $client->getResponse()->getStatusCode()); | ||
293 | |||
294 | $form = $crawler->filter('form[name=entry]')->form(); | ||
295 | |||
296 | $data = [ | ||
297 | 'entry[url]' => $url, | ||
298 | ]; | ||
299 | |||
300 | $client->submit($form, $data); | ||
301 | |||
302 | $this->assertSame(302, $client->getResponse()->getStatusCode()); | ||
303 | $this->assertContains('/view/', $client->getResponse()->getTargetUrl()); | ||
304 | } | ||
305 | |||
306 | /** | ||
307 | * This test will require an internet connection. | ||
308 | */ | ||
272 | public function testPostNewThatWillBeTagged() | 309 | public function testPostNewThatWillBeTagged() |
273 | { | 310 | { |
274 | $this->logInAs('admin'); | 311 | $this->logInAs('admin'); |