use correct share for expected share

Signed-off-by: dartcafe <github@dartcafe.de>
This commit is contained in:
dartcafe 2023-08-31 15:18:11 +02:00
Родитель 616493832a
Коммит b9b1ef09cd
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: CCE73CEF3035D3C8
1 изменённых файлов: 6 добавлений и 4 удалений

Просмотреть файл

@ -89,14 +89,16 @@ class RemoveTest extends TestCase {
*/
public function testValid(array $input, array $pollData): void {
$initialShares = [];
$expectedShares = [];
$expectedShareCount = 0;
$expectedShareTokens = [];
foreach ($pollData['initialShares'] ?? [] as $type => $shares) {
foreach ($shares as $userId) {
$initialShares[] = $this->createShareMock($pollData['pollId'], $type, $userId);
$share = $this->createShareMock($pollData['pollId'], $type, $userId);
$initialShares[] = $share;
if (in_array($userId, $pollData['expectedShares'][$type] ?? [])) {
$expectedShares[] = $userId;
$expectedShares[] = $share;
$expectedShareCount++;
}
}
@ -116,7 +118,7 @@ class RemoveTest extends TestCase {
$this->shareService
->expects($this->exactly($expectedShareCount))
->method('delete')
->with($this->logicalOr(...$initialShares));
->with($this->logicalOr(...$expectedShares));
$command = new Remove(
$this->pollMapper,