Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c0e7f09

Browse files
[Security/Core] fix test
1 parent 09a8d4a commit c0e7f09

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/Symfony/Component/Security/Core/Tests/Authentication/Provider/LdapBindAuthenticationProviderTest.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,12 @@ public function testQueryForDn()
105105
{
106106
$userProvider = $this->createMock(UserProviderInterface::class);
107107

108-
$collection = new \ArrayIterator([new Entry('')]);
108+
$collection = new class([new Entry('')]) extends \ArrayObject implements CollectionInterface {
109+
public function toArray(): array
110+
{
111+
return $this->getArrayCopy();
112+
}
113+
};
109114

110115
$query = $this->createMock(QueryInterface::class);
111116
$query
@@ -146,7 +151,12 @@ public function testQueryWithUserForDn()
146151
{
147152
$userProvider = $this->createMock(UserProviderInterface::class);
148153

149-
$collection = new \ArrayIterator([new Entry('')]);
154+
$collection = new class([new Entry('')]) extends \ArrayObject implements CollectionInterface {
155+
public function toArray(): array
156+
{
157+
return $this->getArrayCopy();
158+
}
159+
};
150160

151161
$query = $this->createMock(QueryInterface::class);
152162
$query

0 commit comments

Comments
 (0)