Skip to content

Commit 933d338

Browse files
committed
AC-15051:[CE] PHPUnit 12: Upgrade Product Types related test cases
1 parent 1dd2127 commit 933d338

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

app/code/Magento/Bundle/Model/LinkManagement.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,10 @@ private function processLinkedProduct(
252252
throw new CouldNotSaveException(__('Could not save child: "%1"', $e->getMessage()), $e);
253253
}
254254

255-
$selectionId = (int)$selectionModel->getId();
256-
$linkedProduct->setId($selectionId);
257-
$linkedProduct->setSelectionId($selectionId);
255+
$linkedProduct->setId($selectionModel->getId());
256+
$linkedProduct->setSelectionId($selectionModel->getId());
258257
$linkedProduct->setOptionId($optionId);
259-
return $selectionId;
258+
return (int)$selectionModel->getId();
260259
}
261260

262261
/**

app/code/Magento/Bundle/Test/Unit/Model/LinkManagementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ public function testAddChild(): void
629629

630630
$selection = $this->createPartialMock(Selection::class, ['save', 'getId', 'load']);
631631
$selection->expects($this->once())->method('save');
632-
$selection->expects($this->once())->method('getId')->willReturn(42);
632+
$selection->method('getId')->willReturn(42);
633633
$this->bundleSelectionMock->expects($this->once())->method('create')->willReturn($selection);
634634
$result = $this->model->addChild($productMock, 1, $productLink);
635635
$this->assertEquals(42, $result);

0 commit comments

Comments
 (0)