22 $helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
23 $this->scopeConfigMock = $this->createMock(\
Magento\Framework\
App\Config\ScopeConfigInterface::class);
25 $this->alerts =
$helper->getObject(
26 \
Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Alerts::class,
27 [
'scopeConfig' => $this->scopeConfigMock]
42 'catalog/productalert/allow_price',
48 'catalog/productalert/allow_stock',
54 $this->scopeConfigMock->expects($this->any())->method(
'getValue')->will($this->returnValueMap($valueMap));
55 $this->assertEquals($canShowTab, $this->alerts->canShowTab());
64 'alert_price_and_stock_allow' => [
true,
true,
true],
65 'alert_price_is_allowed_and_stock_is_unallowed' => [
true,
false,
true],
66 'alert_price_is_unallowed_and_stock_is_allowed' => [
false,
true,
true],
67 'alert_price_is_unallowed_and_stock_is_unallowed' => [
false,
false,
false]
testCanShowTab($priceAllow, $stockAllow, $canShowTab)