diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-03-11 17:56:41 +0100 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-03-11 17:59:42 +0100 |
commit | 09d8bb6fa26b881da478df4c7b97620cb7aea0d0 (patch) | |
tree | 2a81d844c253c5961943ba936445b154d4d32510 /src/Wallabag/AnnotationBundle/Repository | |
parent | 66e2be23717ad8af3cabe5d0c69effd492af3ece (diff) | |
download | wallabag-09d8bb6fa26b881da478df4c7b97620cb7aea0d0.tar.gz wallabag-09d8bb6fa26b881da478df4c7b97620cb7aea0d0.tar.zst wallabag-09d8bb6fa26b881da478df4c7b97620cb7aea0d0.zip |
Improve tests
- add more tests for coverage
- add a test on annotation deletion
- fix post annontation with ranges
Diffstat (limited to 'src/Wallabag/AnnotationBundle/Repository')
-rw-r--r-- | src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php b/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php index c1c6e638..7f35373f 100644 --- a/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php +++ b/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php | |||
@@ -88,4 +88,21 @@ class AnnotationRepository extends EntityRepository | |||
88 | ->getQuery() | 88 | ->getQuery() |
89 | ->getOneOrNullResult(); | 89 | ->getOneOrNullResult(); |
90 | } | 90 | } |
91 | |||
92 | /** | ||
93 | * Used only in test case to get the right annotation associated to the right user. | ||
94 | * | ||
95 | * @param string $username | ||
96 | * | ||
97 | * @return Annotation | ||
98 | */ | ||
99 | public function findOneByUsername($username) | ||
100 | { | ||
101 | return $this->createQueryBuilder('a') | ||
102 | ->leftJoin('a.user', 'u') | ||
103 | ->where('u.username = :username')->setParameter('username', $username) | ||
104 | ->setMaxResults(1) | ||
105 | ->getQuery() | ||
106 | ->getSingleResult(); | ||
107 | } | ||
91 | } | 108 | } |