1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-08-11 17:51:02 +00:00

Merge pull request #5838 from wallabag/feat/mass-action-tag

Add support of mass action to tag entries
This commit is contained in:
Jérémy Benoist 2022-08-22 20:56:04 +02:00 committed by GitHub
commit 2f1f6e9c51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 88 additions and 2 deletions

View file

@ -1698,6 +1698,10 @@ class EntryControllerTest extends WallabagCoreTestCase
$entry2->setUrl($this->url);
$this->getEntityManager()->persist($entry2);
$entry3 = new Entry($this->getLoggedInUser());
$entry3->setUrl($this->url);
$this->getEntityManager()->persist($entry3);
$this->getEntityManager()->flush();
$this->getEntityManager()->clear();
@ -1749,6 +1753,36 @@ class EntryControllerTest extends WallabagCoreTestCase
$this->assertSame(1, $res->isStarred());
// Mass actions : tag
$client->request('POST', '/mass', [
'tag' => '',
'tags' => 'foo',
'entry-checkbox' => $entries,
]);
$this->assertSame(302, $client->getResponse()->getStatusCode());
$res = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->find($entry1->getId());
$this->assertContains('foo', $res->getTagsLabel());
$res = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->find($entry2->getId());
$this->assertContains('foo', $res->getTagsLabel());
$res = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->find($entry3->getId());
$this->assertNotContains('foo', $res->getTagsLabel());
// Mass actions : delete
$client->request('POST', '/mass', [
'delete' => '',