Skip to content

Commit 3c58a26

Browse files
committed
Don't call createMock with an array of interfaces.
1 parent 0eabadd commit 3c58a26

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Tests/Security/User/EntityUserProviderTest.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)