mirror of
https://github.com/wallabag/wallabag.git
synced 2025-02-07 11:13:34 +01:00
Fix tests
This commit is contained in:
parent
5077c46e4e
commit
9f6414785c
@ -193,7 +193,7 @@ class TagController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tag search results with the current search term
|
* Tag search results with the current search term.
|
||||||
*
|
*
|
||||||
* @Route("/tag/search/{filter}", name="tag_this_search")
|
* @Route("/tag/search/{filter}", name="tag_this_search")
|
||||||
*
|
*
|
||||||
@ -201,7 +201,7 @@ class TagController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function tagThisSearchAction($filter, Request $request)
|
public function tagThisSearchAction($filter, Request $request)
|
||||||
{
|
{
|
||||||
$currentRoute = (null !== $request->query->get('currentRoute') ? $request->query->get('currentRoute') : '');
|
$currentRoute = $request->query->has('currentRoute') ? $request->query->get('currentRoute') : '';
|
||||||
|
|
||||||
/** @var QueryBuilder $qb */
|
/** @var QueryBuilder $qb */
|
||||||
$qb = $this->get('wallabag_core.entry_repository')->getBuilderForSearchByUser($this->getUser()->getId(), $filter, $currentRoute);
|
$qb = $this->get('wallabag_core.entry_repository')->getBuilderForSearchByUser($this->getUser()->getId(), $filter, $currentRoute);
|
||||||
|
@ -237,7 +237,7 @@ entry:
|
|||||||
toogle_as_star: Toggle starred
|
toogle_as_star: Toggle starred
|
||||||
delete: Delete
|
delete: Delete
|
||||||
export_title: Export
|
export_title: Export
|
||||||
assign_search_tag: Assign this search to results
|
assign_search_tag: Assign this search as a tag to each result
|
||||||
filters:
|
filters:
|
||||||
title: Filters
|
title: Filters
|
||||||
status_label: Status
|
status_label: Status
|
||||||
|
@ -482,12 +482,6 @@ class TagControllerTest extends WallabagCoreTestCase
|
|||||||
$this->logInAs('admin');
|
$this->logInAs('admin');
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
|
|
||||||
$entry = new Entry($this->getLoggedInUser());
|
|
||||||
$entry->setUrl('https://wallabag/');
|
|
||||||
$entry->setTitle('title');
|
|
||||||
$this->getEntityManager()->persist($entry);
|
|
||||||
$this->getEntityManager()->flush();
|
|
||||||
|
|
||||||
// Search on unread list
|
// Search on unread list
|
||||||
$crawler = $client->request('GET', '/unread/list');
|
$crawler = $client->request('GET', '/unread/list');
|
||||||
|
|
||||||
@ -498,17 +492,19 @@ class TagControllerTest extends WallabagCoreTestCase
|
|||||||
|
|
||||||
$crawler = $client->submit($form, $data);
|
$crawler = $client->submit($form, $data);
|
||||||
|
|
||||||
$crawler = $client->click($crawler->selectLink('entry.list.assign_search_tag')->link());
|
$client->click($crawler->selectLink('entry.list.assign_search_tag')->link());
|
||||||
$crawler = $client->followRedirect();
|
$client->followRedirect();
|
||||||
|
|
||||||
$entries = $client->getContainer()
|
$entries = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository('WallabagCoreBundle:Entry')
|
||||||
->getBuilderForSearchByUser($this->getLoggedInUserId(), 'title', 'unread');
|
->getBuilderForSearchByUser($this->getLoggedInUserId(), 'title', 'unread')
|
||||||
|
->getQuery()->getResult();
|
||||||
|
|
||||||
foreach ($entries as $entry) {
|
foreach ($entries as $entry) {
|
||||||
$tags = $entry->getTags()->toArray();
|
$tags = $entry->getTagsLabel();
|
||||||
$this->assertStringContainsString('title', $tags);
|
|
||||||
|
$this->assertContains('title', $tags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user