mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
Improve tests
- add more tests for coverage - add a test on annotation deletion - fix post annontation with ranges
This commit is contained in:
parent
66e2be2371
commit
09d8bb6fa2
5 changed files with 68 additions and 17 deletions
|
@ -88,4 +88,21 @@ class AnnotationRepository extends EntityRepository
|
|||
->getQuery()
|
||||
->getOneOrNullResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* Used only in test case to get the right annotation associated to the right user.
|
||||
*
|
||||
* @param string $username
|
||||
*
|
||||
* @return Annotation
|
||||
*/
|
||||
public function findOneByUsername($username)
|
||||
{
|
||||
return $this->createQueryBuilder('a')
|
||||
->leftJoin('a.user', 'u')
|
||||
->where('u.username = :username')->setParameter('username', $username)
|
||||
->setMaxResults(1)
|
||||
->getQuery()
|
||||
->getSingleResult();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue