@@ -63,20 +63,12 @@ public function setUp()
63
63
->getMock ()
64
64
;
65
65
66
- $ this ->entityManager
67
- ->expects ($ this ->once ())
68
- ->method ('getRepository ' )
69
- ->with ($ this ->className )
70
- ->willReturn ($ this ->repository )
71
- ;
72
-
73
66
$ this ->instance = new TokenManager ($ this ->entityManager , $ this ->className );
74
67
}
75
68
76
69
public function testConstructWillSetParameters ()
77
70
{
78
71
$ this ->assertAttributeSame ($ this ->entityManager , 'em ' , $ this ->instance );
79
- $ this ->assertAttributeSame ($ this ->repository , 'repository ' , $ this ->instance );
80
72
$ this ->assertAttributeSame ($ this ->className , 'class ' , $ this ->instance );
81
73
}
82
74
@@ -112,6 +104,13 @@ public function testFindTokenBy()
112
104
\random_bytes (5 ),
113
105
];
114
106
107
+ $ this ->entityManager
108
+ ->expects ($ this ->once ())
109
+ ->method ('getRepository ' )
110
+ ->with ($ this ->className )
111
+ ->willReturn ($ this ->repository )
112
+ ;
113
+
115
114
$ this ->repository
116
115
->expects ($ this ->once ())
117
116
->method ('findOneBy ' )
@@ -174,6 +173,13 @@ public function testDeleteExpired()
174
173
{
175
174
$ randomResult = \random_bytes (10 );
176
175
176
+ $ this ->entityManager
177
+ ->expects ($ this ->once ())
178
+ ->method ('getRepository ' )
179
+ ->with ($ this ->className )
180
+ ->willReturn ($ this ->repository )
181
+ ;
182
+
177
183
$ queryBuilder = $ this ->getMockBuilder (QueryBuilder::class)
178
184
->disableOriginalConstructor ()
179
185
->getMock ()
0 commit comments