@@ -70,7 +70,7 @@ public function testLoadUserByUsernameWithUserLoaderRepositoryAndWithoutProperty
70
70
{
71
71
$ user = new User (1 , 1 , 'user1 ' );
72
72
73
- $ repository = $ this ->createMock ([ObjectRepository ::class, UserLoaderInterface::class] );
73
+ $ repository = $ this ->createMock (UserLoaderRepository ::class);
74
74
$ repository
75
75
->expects ($ this ->once ())
76
76
->method ('loadUserByUsername ' )
@@ -156,7 +156,7 @@ public function testSupportProxy()
156
156
157
157
public function testLoadUserByUserNameShouldLoadUserWhenProperInterfaceProvided ()
158
158
{
159
- $ repository = $ this ->createMock ([ObjectRepository ::class, UserLoaderInterface::class] );
159
+ $ repository = $ this ->createMock (UserLoaderRepository ::class);
160
160
$ repository ->expects ($ this ->once ())
161
161
->method ('loadUserByUsername ' )
162
162
->with ('name ' )
@@ -189,7 +189,7 @@ public function testPasswordUpgrades()
189
189
{
190
190
$ user = new User (1 , 1 , 'user1 ' );
191
191
192
- $ repository = $ this ->createMock ([ interface_exists (ObjectRepository ::class) ? ObjectRepository::class : LegacyObjectRepository::class, PasswordUpgraderInterface::class] );
192
+ $ repository = $ this ->createMock (PasswordUpgraderRepository ::class);
193
193
$ repository ->expects ($ this ->once ())
194
194
->method ('upgradePassword ' )
195
195
->with ($ user , 'foobar ' );
@@ -233,3 +233,11 @@ private function createSchema($em)
233
233
]);
234
234
}
235
235
}
236
+
237
+ abstract class UserLoaderRepository implements ObjectRepository, UserLoaderInterface
238
+ {
239
+ }
240
+
241
+ abstract class PasswordUpgraderRepository implements ObjectRepository, PasswordUpgraderInterface
242
+ {
243
+ }
0 commit comments