@@ -57,10 +57,11 @@ protected function setUp(): void
57
57
* @param bool $isSalable
58
58
* @param array $isInStock
59
59
* @param bool $isShowOutOfStock
60
- * @return boolean
60
+ * @param bool $expectedBool
61
+ * @return void
61
62
* @dataProvider isAvailableForCompareDataProvider
62
63
*/
63
- public function testIsAvailableForCompare ($ status , $ isSalable , $ isInStock , $ isShowOutOfStock ): bool
64
+ public function testIsAvailableForCompare ($ status , $ isSalable , $ isInStock , $ isShowOutOfStock, $ expectedBool ): void
64
65
{
65
66
$ productMock = $ this ->getMockBuilder (Product::class)
66
67
->disableOriginalConstructor ()
@@ -82,7 +83,7 @@ public function testIsAvailableForCompare($status, $isSalable, $isInStock, $isSh
82
83
->method ('isShowOutOfStock ' )
83
84
->willReturn ($ isShowOutOfStock );
84
85
85
- return $ this ->viewModel ->isAvailableForCompare ($ productMock );
86
+ $ this -> assertEquals ( $ expectedBool , $ this ->viewModel ->isAvailableForCompare ($ productMock) );
86
87
}
87
88
88
89
/**
@@ -93,11 +94,11 @@ public function testIsAvailableForCompare($status, $isSalable, $isInStock, $isSh
93
94
public function isAvailableForCompareDataProvider (): array
94
95
{
95
96
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 ]
101
102
];
102
103
}
103
104
}
0 commit comments