Skip to content

Commit 97fe3ff

Browse files
committed
Assert added with expected results
1 parent 0b806f9 commit 97fe3ff

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,11 @@ protected function setUp(): void
5757
* @param bool $isSalable
5858
* @param array $isInStock
5959
* @param bool $isShowOutOfStock
60-
* @return boolean
60+
* @param bool $expectedBool
61+
* @return void
6162
* @dataProvider isAvailableForCompareDataProvider
6263
*/
63-
public function testIsAvailableForCompare($status, $isSalable, $isInStock, $isShowOutOfStock): bool
64+
public function testIsAvailableForCompare($status, $isSalable, $isInStock, $isShowOutOfStock, $expectedBool): void
6465
{
6566
$productMock = $this->getMockBuilder(Product::class)
6667
->disableOriginalConstructor()
@@ -82,7 +83,7 @@ public function testIsAvailableForCompare($status, $isSalable, $isInStock, $isSh
8283
->method('isShowOutOfStock')
8384
->willReturn($isShowOutOfStock);
8485

85-
return $this->viewModel->isAvailableForCompare($productMock);
86+
$this->assertEquals($expectedBool, $this->viewModel->isAvailableForCompare($productMock));
8687
}
8788

8889
/**
@@ -93,11 +94,11 @@ public function testIsAvailableForCompare($status, $isSalable, $isInStock, $isSh
9394
public function isAvailableForCompareDataProvider(): array
9495
{
9596
return [
96-
[1, true, ['is_in_stock' => true], false],
97-
[1, true, ['is_in_stock' => false], true],
98-
[1, true, [], false],
99-
[1, false, [], false],
100-
[2, true, ['is_in_stock' => true], false]
97+
[1, true, ['is_in_stock' => true], false, true],
98+
[1, true, ['is_in_stock' => false], true, true],
99+
[1, true, [], false, true],
100+
[1, false, [], false, false],
101+
[2, true, ['is_in_stock' => true], false, false]
101102
];
102103
}
103104
}

0 commit comments

Comments
 (0)