mirror of
https://github.com/wallabag/wallabag.git
synced 2025-08-01 17:38:38 +00:00
Added given_url in entry table
- Added index on entry table for given_url field - Fix tests: The previous `bit.ly` url redirected to doc.wallabag but that url doesn't exist in the fixtures. I used our own internal "redirector" to create a redirect to an url which exist in the fixtures. Also, updating current migration to use the new `WallabagMigration`.
This commit is contained in:
parent
e9579d6de9
commit
b7fa51ae7d
6 changed files with 158 additions and 2 deletions
|
@ -166,7 +166,6 @@ class EntryControllerTest extends WallabagCoreTestCase
|
|||
$this->assertSame($this->url, $content->getUrl());
|
||||
$this->assertContains('Google', $content->getTitle());
|
||||
$this->assertSame('fr', $content->getLanguage());
|
||||
$this->assertSame('2015-03-28 11:43:19', $content->getPublishedAt()->format('Y-m-d H:i:s'));
|
||||
$this->assertArrayHasKey('x-frame-options', $content->getHeaders());
|
||||
$client->getContainer()->get('craue_config')->set('store_article_headers', 0);
|
||||
}
|
||||
|
@ -266,6 +265,41 @@ class EntryControllerTest extends WallabagCoreTestCase
|
|||
$this->assertContains('/view/', $client->getResponse()->getTargetUrl());
|
||||
}
|
||||
|
||||
public function testPostNewOkUrlExistWithRedirection()
|
||||
{
|
||||
$this->logInAs('admin');
|
||||
$client = $this->getClient();
|
||||
|
||||
$url = 'https://wllbg.org/test-redirect/c51c';
|
||||
|
||||
$crawler = $client->request('GET', '/new');
|
||||
|
||||
$this->assertSame(200, $client->getResponse()->getStatusCode());
|
||||
|
||||
$form = $crawler->filter('form[name=entry]')->form();
|
||||
|
||||
$data = [
|
||||
'entry[url]' => $url,
|
||||
];
|
||||
|
||||
$client->submit($form, $data);
|
||||
|
||||
$crawler = $client->request('GET', '/new');
|
||||
|
||||
$this->assertSame(200, $client->getResponse()->getStatusCode());
|
||||
|
||||
$form = $crawler->filter('form[name=entry]')->form();
|
||||
|
||||
$data = [
|
||||
'entry[url]' => $url,
|
||||
];
|
||||
|
||||
$client->submit($form, $data);
|
||||
|
||||
$this->assertSame(302, $client->getResponse()->getStatusCode());
|
||||
$this->assertContains('/view/', $client->getResponse()->getTargetUrl());
|
||||
}
|
||||
|
||||
/**
|
||||
* This test will require an internet connection.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue