@@ -70,7 +70,7 @@ public function testLoadUserByUsernameWithUserLoaderRepositoryAndWithoutProperty
7070 {
7171 $ user = new User (1 , 1 , 'user1 ' );
7272
73- $ repository = $ this ->createMock ([ObjectRepository ::class, UserLoaderInterface::class] );
73+ $ repository = $ this ->createMock (UserLoaderRepository ::class);
7474 $ repository
7575 ->expects ($ this ->once ())
7676 ->method ('loadUserByUsername ' )
@@ -156,7 +156,7 @@ public function testSupportProxy()
156156
157157 public function testLoadUserByUserNameShouldLoadUserWhenProperInterfaceProvided ()
158158 {
159- $ repository = $ this ->createMock ([ObjectRepository ::class, UserLoaderInterface::class] );
159+ $ repository = $ this ->createMock (UserLoaderRepository ::class);
160160 $ repository ->expects ($ this ->once ())
161161 ->method ('loadUserByUsername ' )
162162 ->with ('name ' )
@@ -189,7 +189,7 @@ public function testPasswordUpgrades()
189189 {
190190 $ user = new User (1 , 1 , 'user1 ' );
191191
192- $ repository = $ this ->createMock ([ interface_exists (ObjectRepository ::class) ? ObjectRepository::class : LegacyObjectRepository::class, PasswordUpgraderInterface::class] );
192+ $ repository = $ this ->createMock (PasswordUpgraderRepository ::class);
193193 $ repository ->expects ($ this ->once ())
194194 ->method ('upgradePassword ' )
195195 ->with ($ user , 'foobar ' );
@@ -233,3 +233,11 @@ private function createSchema($em)
233233 ]);
234234 }
235235}
236+
237+ abstract class UserLoaderRepository implements ObjectRepository, UserLoaderInterface
238+ {
239+ }
240+
241+ abstract class PasswordUpgraderRepository implements ObjectRepository, PasswordUpgraderInterface
242+ {
243+ }
0 commit comments