1
0
Fork 0
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:
Jeremy Benoist 2016-03-11 17:56:41 +01:00
parent 66e2be2371
commit 09d8bb6fa2
5 changed files with 68 additions and 17 deletions

View file

@ -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();
}
}