Skip to content

Commit

Permalink
Assert added with expected results
Browse files Browse the repository at this point in the history
  • Loading branch information
srsathish92 committed Dec 14, 2019
1 parent 0b806f9 commit 97fe3ff
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ protected function setUp(): void
* @param bool $isSalable
* @param array $isInStock
* @param bool $isShowOutOfStock
* @return boolean
* @param bool $expectedBool
* @return void
* @dataProvider isAvailableForCompareDataProvider
*/
public function testIsAvailableForCompare($status, $isSalable, $isInStock, $isShowOutOfStock): bool
public function testIsAvailableForCompare($status, $isSalable, $isInStock, $isShowOutOfStock, $expectedBool): void
{
$productMock = $this->getMockBuilder(Product::class)
->disableOriginalConstructor()
Expand All @@ -82,7 +83,7 @@ public function testIsAvailableForCompare($status, $isSalable, $isInStock, $isSh
->method('isShowOutOfStock')
->willReturn($isShowOutOfStock);

return $this->viewModel->isAvailableForCompare($productMock);
$this->assertEquals($expectedBool, $this->viewModel->isAvailableForCompare($productMock));
}

/**
Expand All @@ -93,11 +94,11 @@ public function testIsAvailableForCompare($status, $isSalable, $isInStock, $isSh
public function isAvailableForCompareDataProvider(): array
{
return [
[1, true, ['is_in_stock' => true], false],
[1, true, ['is_in_stock' => false], true],
[1, true, [], false],
[1, false, [], false],
[2, true, ['is_in_stock' => true], false]
[1, true, ['is_in_stock' => true], false, true],
[1, true, ['is_in_stock' => false], true, true],
[1, true, [], false, true],
[1, false, [], false, false],
[2, true, ['is_in_stock' => true], false, false]
];
}
}

0 comments on commit 97fe3ff

Please sign in to comment.