Merge pull request #5381 from wallabag/tag-search-results

This commit is contained in:
Jérémy Benoist
2022-05-13 07:09:18 +02:00
committed by GitHub
4 changed files with 65 additions and 0 deletions

View File

@ -476,4 +476,35 @@ class TagControllerTest extends WallabagCoreTestCase
$this->assertNotFalse(array_search('cache', $tags, true), 'Tag cache is assigned to the entry');
$this->assertNotFalse(array_search('caché', $tags, true), 'Tag caché is assigned to the entry');
}
public function testAssignTagsOnSearchResults()
{
$this->logInAs('admin');
$client = $this->getClient();
// Search on unread list
$crawler = $client->request('GET', '/unread/list');
$form = $crawler->filter('form[name=search]')->form();
$data = [
'search_entry[term]' => 'title',
];
$crawler = $client->submit($form, $data);
$client->click($crawler->selectLink('entry.list.assign_search_tag')->link());
$client->followRedirect();
$entries = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getBuilderForSearchByUser($this->getLoggedInUserId(), 'title', 'unread')
->getQuery()->getResult();
foreach ($entries as $entry) {
$tags = $entry->getTagsLabel();
$this->assertContains('title', $tags);
}
}
}