diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2019-05-10 15:49:39 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2019-05-10 15:49:39 +0200 |
commit | 77bd7f690db45be10a32fe4ceebccdd0edf7c24f (patch) | |
tree | 4f65d8272396150ff3a5badb99b0853f864e6ae5 /tests/Wallabag/CoreBundle/ParamConverter | |
parent | 1ca9310f5e2daf5904754125ba7da7d73d6587ce (diff) | |
download | wallabag-77bd7f690db45be10a32fe4ceebccdd0edf7c24f.tar.gz wallabag-77bd7f690db45be10a32fe4ceebccdd0edf7c24f.tar.zst wallabag-77bd7f690db45be10a32fe4ceebccdd0edf7c24f.zip |
CS
Diffstat (limited to 'tests/Wallabag/CoreBundle/ParamConverter')
-rw-r--r-- | tests/Wallabag/CoreBundle/ParamConverter/UsernameFeedTokenConverterTest.php | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/tests/Wallabag/CoreBundle/ParamConverter/UsernameFeedTokenConverterTest.php b/tests/Wallabag/CoreBundle/ParamConverter/UsernameFeedTokenConverterTest.php index 92fe38cd..48c82dde 100644 --- a/tests/Wallabag/CoreBundle/ParamConverter/UsernameFeedTokenConverterTest.php +++ b/tests/Wallabag/CoreBundle/ParamConverter/UsernameFeedTokenConverterTest.php | |||
@@ -26,7 +26,7 @@ class UsernameFeedTokenConverterTest extends TestCase | |||
26 | 26 | ||
27 | $registry->expects($this->once()) | 27 | $registry->expects($this->once()) |
28 | ->method('getManagers') | 28 | ->method('getManagers') |
29 | ->will($this->returnValue([])); | 29 | ->willReturn([]); |
30 | 30 | ||
31 | $params = new ParamConverter([]); | 31 | $params = new ParamConverter([]); |
32 | $converter = new UsernameFeedTokenConverter($registry); | 32 | $converter = new UsernameFeedTokenConverter($registry); |
@@ -42,7 +42,7 @@ class UsernameFeedTokenConverterTest extends TestCase | |||
42 | 42 | ||
43 | $registry->expects($this->once()) | 43 | $registry->expects($this->once()) |
44 | ->method('getManagers') | 44 | ->method('getManagers') |
45 | ->will($this->returnValue(['default' => null])); | 45 | ->willReturn(['default' => null]); |
46 | 46 | ||
47 | $params = new ParamConverter([]); | 47 | $params = new ParamConverter([]); |
48 | $converter = new UsernameFeedTokenConverter($registry); | 48 | $converter = new UsernameFeedTokenConverter($registry); |
@@ -58,7 +58,7 @@ class UsernameFeedTokenConverterTest extends TestCase | |||
58 | 58 | ||
59 | $meta->expects($this->once()) | 59 | $meta->expects($this->once()) |
60 | ->method('getName') | 60 | ->method('getName') |
61 | ->will($this->returnValue('nothingrelated')); | 61 | ->willReturn('nothingrelated'); |
62 | 62 | ||
63 | $em = $this->getMockBuilder('Doctrine\Common\Persistence\ObjectManager') | 63 | $em = $this->getMockBuilder('Doctrine\Common\Persistence\ObjectManager') |
64 | ->disableOriginalConstructor() | 64 | ->disableOriginalConstructor() |
@@ -67,7 +67,7 @@ class UsernameFeedTokenConverterTest extends TestCase | |||
67 | $em->expects($this->once()) | 67 | $em->expects($this->once()) |
68 | ->method('getClassMetadata') | 68 | ->method('getClassMetadata') |
69 | ->with('superclass') | 69 | ->with('superclass') |
70 | ->will($this->returnValue($meta)); | 70 | ->willReturn($meta); |
71 | 71 | ||
72 | $registry = $this->getMockBuilder('Doctrine\Common\Persistence\ManagerRegistry') | 72 | $registry = $this->getMockBuilder('Doctrine\Common\Persistence\ManagerRegistry') |
73 | ->disableOriginalConstructor() | 73 | ->disableOriginalConstructor() |
@@ -75,12 +75,12 @@ class UsernameFeedTokenConverterTest extends TestCase | |||
75 | 75 | ||
76 | $registry->expects($this->once()) | 76 | $registry->expects($this->once()) |
77 | ->method('getManagers') | 77 | ->method('getManagers') |
78 | ->will($this->returnValue(['default' => null])); | 78 | ->willReturn(['default' => null]); |
79 | 79 | ||
80 | $registry->expects($this->once()) | 80 | $registry->expects($this->once()) |
81 | ->method('getManagerForClass') | 81 | ->method('getManagerForClass') |
82 | ->with('superclass') | 82 | ->with('superclass') |
83 | ->will($this->returnValue($em)); | 83 | ->willReturn($em); |
84 | 84 | ||
85 | $params = new ParamConverter(['class' => 'superclass']); | 85 | $params = new ParamConverter(['class' => 'superclass']); |
86 | $converter = new UsernameFeedTokenConverter($registry); | 86 | $converter = new UsernameFeedTokenConverter($registry); |
@@ -96,7 +96,7 @@ class UsernameFeedTokenConverterTest extends TestCase | |||
96 | 96 | ||
97 | $meta->expects($this->once()) | 97 | $meta->expects($this->once()) |
98 | ->method('getName') | 98 | ->method('getName') |
99 | ->will($this->returnValue('Wallabag\UserBundle\Entity\User')); | 99 | ->willReturn('Wallabag\UserBundle\Entity\User'); |
100 | 100 | ||
101 | $em = $this->getMockBuilder('Doctrine\Common\Persistence\ObjectManager') | 101 | $em = $this->getMockBuilder('Doctrine\Common\Persistence\ObjectManager') |
102 | ->disableOriginalConstructor() | 102 | ->disableOriginalConstructor() |
@@ -105,7 +105,7 @@ class UsernameFeedTokenConverterTest extends TestCase | |||
105 | $em->expects($this->once()) | 105 | $em->expects($this->once()) |
106 | ->method('getClassMetadata') | 106 | ->method('getClassMetadata') |
107 | ->with('WallabagUserBundle:User') | 107 | ->with('WallabagUserBundle:User') |
108 | ->will($this->returnValue($meta)); | 108 | ->willReturn($meta); |
109 | 109 | ||
110 | $registry = $this->getMockBuilder('Doctrine\Common\Persistence\ManagerRegistry') | 110 | $registry = $this->getMockBuilder('Doctrine\Common\Persistence\ManagerRegistry') |
111 | ->disableOriginalConstructor() | 111 | ->disableOriginalConstructor() |
@@ -113,12 +113,12 @@ class UsernameFeedTokenConverterTest extends TestCase | |||
113 | 113 | ||
114 | $registry->expects($this->once()) | 114 | $registry->expects($this->once()) |
115 | ->method('getManagers') | 115 | ->method('getManagers') |
116 | ->will($this->returnValue(['default' => null])); | 116 | ->willReturn(['default' => null]); |
117 | 117 | ||
118 | $registry->expects($this->once()) | 118 | $registry->expects($this->once()) |
119 | ->method('getManagerForClass') | 119 | ->method('getManagerForClass') |
120 | ->with('WallabagUserBundle:User') | 120 | ->with('WallabagUserBundle:User') |
121 | ->will($this->returnValue($em)); | 121 | ->willReturn($em); |
122 | 122 | ||
123 | $params = new ParamConverter(['class' => 'WallabagUserBundle:User']); | 123 | $params = new ParamConverter(['class' => 'WallabagUserBundle:User']); |
124 | $converter = new UsernameFeedTokenConverter($registry); | 124 | $converter = new UsernameFeedTokenConverter($registry); |
@@ -149,7 +149,7 @@ class UsernameFeedTokenConverterTest extends TestCase | |||
149 | $repo->expects($this->once()) | 149 | $repo->expects($this->once()) |
150 | ->method('findOneByUsernameAndFeedToken') | 150 | ->method('findOneByUsernameAndFeedToken') |
151 | ->with('test', 'test') | 151 | ->with('test', 'test') |
152 | ->will($this->returnValue(null)); | 152 | ->willReturn(null); |
153 | 153 | ||
154 | $em = $this->getMockBuilder('Doctrine\Common\Persistence\ObjectManager') | 154 | $em = $this->getMockBuilder('Doctrine\Common\Persistence\ObjectManager') |
155 | ->disableOriginalConstructor() | 155 | ->disableOriginalConstructor() |
@@ -158,7 +158,7 @@ class UsernameFeedTokenConverterTest extends TestCase | |||
158 | $em->expects($this->once()) | 158 | $em->expects($this->once()) |
159 | ->method('getRepository') | 159 | ->method('getRepository') |
160 | ->with('WallabagUserBundle:User') | 160 | ->with('WallabagUserBundle:User') |
161 | ->will($this->returnValue($repo)); | 161 | ->willReturn($repo); |
162 | 162 | ||
163 | $registry = $this->getMockBuilder('Doctrine\Common\Persistence\ManagerRegistry') | 163 | $registry = $this->getMockBuilder('Doctrine\Common\Persistence\ManagerRegistry') |
164 | ->disableOriginalConstructor() | 164 | ->disableOriginalConstructor() |
@@ -167,7 +167,7 @@ class UsernameFeedTokenConverterTest extends TestCase | |||
167 | $registry->expects($this->once()) | 167 | $registry->expects($this->once()) |
168 | ->method('getManagerForClass') | 168 | ->method('getManagerForClass') |
169 | ->with('WallabagUserBundle:User') | 169 | ->with('WallabagUserBundle:User') |
170 | ->will($this->returnValue($em)); | 170 | ->willReturn($em); |
171 | 171 | ||
172 | $params = new ParamConverter(['class' => 'WallabagUserBundle:User']); | 172 | $params = new ParamConverter(['class' => 'WallabagUserBundle:User']); |
173 | $converter = new UsernameFeedTokenConverter($registry); | 173 | $converter = new UsernameFeedTokenConverter($registry); |
@@ -187,7 +187,7 @@ class UsernameFeedTokenConverterTest extends TestCase | |||
187 | $repo->expects($this->once()) | 187 | $repo->expects($this->once()) |
188 | ->method('findOneByUsernameAndFeedtoken') | 188 | ->method('findOneByUsernameAndFeedtoken') |
189 | ->with('test', 'test') | 189 | ->with('test', 'test') |
190 | ->will($this->returnValue($user)); | 190 | ->willReturn($user); |
191 | 191 | ||
192 | $em = $this->getMockBuilder('Doctrine\Common\Persistence\ObjectManager') | 192 | $em = $this->getMockBuilder('Doctrine\Common\Persistence\ObjectManager') |
193 | ->disableOriginalConstructor() | 193 | ->disableOriginalConstructor() |
@@ -196,7 +196,7 @@ class UsernameFeedTokenConverterTest extends TestCase | |||
196 | $em->expects($this->once()) | 196 | $em->expects($this->once()) |
197 | ->method('getRepository') | 197 | ->method('getRepository') |
198 | ->with('WallabagUserBundle:User') | 198 | ->with('WallabagUserBundle:User') |
199 | ->will($this->returnValue($repo)); | 199 | ->willReturn($repo); |
200 | 200 | ||
201 | $registry = $this->getMockBuilder('Doctrine\Common\Persistence\ManagerRegistry') | 201 | $registry = $this->getMockBuilder('Doctrine\Common\Persistence\ManagerRegistry') |
202 | ->disableOriginalConstructor() | 202 | ->disableOriginalConstructor() |
@@ -205,7 +205,7 @@ class UsernameFeedTokenConverterTest extends TestCase | |||
205 | $registry->expects($this->once()) | 205 | $registry->expects($this->once()) |
206 | ->method('getManagerForClass') | 206 | ->method('getManagerForClass') |
207 | ->with('WallabagUserBundle:User') | 207 | ->with('WallabagUserBundle:User') |
208 | ->will($this->returnValue($em)); | 208 | ->willReturn($em); |
209 | 209 | ||
210 | $params = new ParamConverter(['class' => 'WallabagUserBundle:User', 'name' => 'user']); | 210 | $params = new ParamConverter(['class' => 'WallabagUserBundle:User', 'name' => 'user']); |
211 | $converter = new UsernameFeedTokenConverter($registry); | 211 | $converter = new UsernameFeedTokenConverter($registry); |