1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-09-15 18:57:05 +00:00

Remove session-based redirection

This commit is contained in:
Yassine Guedidi 2023-12-25 21:42:08 +01:00
parent f4493f7472
commit 7ebc96f3b9
11 changed files with 52 additions and 41 deletions

View file

@ -1302,8 +1302,10 @@ class EntryControllerTest extends WallabagCoreTestCase
$this->getEntityManager()->flush();
$client->request('GET', '/view/' . $entry->getId());
$client->request('GET', '/archive/' . $entry->getId());
$crawler = $client->request('GET', '/view/' . $entry->getId());
$link = $crawler->filter('a[id="markAsRead"]')->link();
$client->click($link);
$this->assertSame(302, $client->getResponse()->getStatusCode());
$this->assertStringContainsString('/view/' . $entry->getId(), $client->getResponse()->headers->get('location'));
@ -1656,7 +1658,7 @@ class EntryControllerTest extends WallabagCoreTestCase
// the deletion link of the first tag
$link = $crawler->filter('body div#article div.tools ul.tags li.chip a')->extract(['href'])[1];
$this->assertSame(sprintf('/remove-tag/%s/%s', $entry->getId(), $tag->getId()), $link);
$this->assertStringStartsWith(sprintf('/remove-tag/%s/%s', $entry->getId(), $tag->getId()), $link);
}
public function testRandom()

View file

@ -123,9 +123,11 @@ class TagControllerTest extends WallabagCoreTestCase
$this->getEntityManager()->clear();
// We make a first request to set an history and test redirection after tag deletion
$client->request('GET', '/view/' . $entry->getId());
$crawler = $client->request('GET', '/view/' . $entry->getId());
$entryUri = $client->getRequest()->getRequestUri();
$client->request('GET', '/remove-tag/' . $entry->getId() . '/' . $tag->getId());
$link = $crawler->filter('a[href^="/remove-tag/' . $entry->getId() . '/' . $tag->getId() . '"]')->link();
$client->click($link);
$this->assertSame(302, $client->getResponse()->getStatusCode());
$this->assertSame($entryUri, $client->getResponse()->getTargetUrl());