Skip to content

Commit 980159b

Browse files
author
Eric Bohanon
committed
MAGETWO-71257: Need to disable module output
1 parent 366b3ad commit 980159b

File tree

7 files changed

+23
-3
lines changed

7 files changed

+23
-3
lines changed

app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Options/AjaxTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ public function testToHtml()
5858
->getMock();
5959
$eventManager->expects($this->exactly(2))->method('dispatch')->will($this->returnValue(true));
6060

61+
$scopeConfig = $this->getMockBuilder(\Magento\Framework\App\Config::class)
62+
->setMethods(['getValue'])
63+
->disableOriginalConstructor()->getMock();
64+
$scopeConfig->expects($this->once())->method('getValue')->withAnyParameters()
65+
->will($this->returnValue(false));
66+
6167
$product = $this->getMockBuilder(\Magento\Catalog\Model\Product::class)->disableOriginalConstructor()
6268
->setMethods(['setStoreId', 'load', 'getId', '__wakeup', '__sleep'])
6369
->getMock();
@@ -90,6 +96,8 @@ public function testToHtml()
9096

9197
$this->context->expects($this->once())->method('getEventManager')
9298
->will($this->returnValue($eventManager));
99+
$this->context->expects($this->once())->method('getScopeConfig')
100+
->will($this->returnValue($scopeConfig));
93101
$this->context->expects($this->once())->method('getLayout')
94102
->will($this->returnValue($layout));
95103
$this->context->expects($this->once())->method('getRequest')

app/code/Magento/Catalog/Test/Unit/Block/Product/Widget/NewWidgetTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ protected function generalGetProductCollection()
186186
{
187187
$this->eventManager->expects($this->exactly(2))->method('dispatch')
188188
->will($this->returnValue(true));
189+
$this->scopeConfig->expects($this->once())->method('getValue')->withAnyParameters()
190+
->willReturn(false);
189191
$this->cacheState->expects($this->atLeastOnce())->method('isEnabled')->withAnyParameters()
190192
->willReturn(false);
191193
$this->catalogConfig->expects($this->once())->method('getProductAttributes')

app/code/Magento/Checkout/Test/Unit/Block/Cart/Item/Renderer/ActionsTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ public function testToHtml()
6868
$childNameTwo = 'child.2';
6969
$childNames = [$childNameOne, $childNameTwo];
7070

71+
$this->scopeConfigMock->expects($this->once())
72+
->method('getValue')
73+
->willReturn(false);
74+
7175
/**
7276
* @var Item|\PHPUnit_Framework_MockObject_MockObject $itemMock
7377
*/

app/code/Magento/Payment/Test/Unit/Block/Info/SubstitutionTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ public function testBeforeToHtml()
9393
$this->layout->expects($this->any())
9494
->method('createBlock')
9595
->with(
96-
\Magento\Framework\View\Element\Template::class,
97-
'',
96+
\Magento\Framework\View\Element\Template::class, '',
9897
['data' => ['method' => $methodMock, 'template' => 'Magento_Payment::info/substitution.phtml']]
9998
)->willReturn($fakeBlock);
10099

app/code/Magento/Paypal/Test/Unit/Block/Billing/AgreementsTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,10 @@ public function testToHtml()
231231
->expects($this->at(1))
232232
->method('dispatch')
233233
->with('view_block_abstract_to_html_after', ['block' => $this->block, 'transport' => $transport]);
234+
$this->scopeConfig
235+
->expects($this->once())
236+
->method('getValue')
237+
->willReturn(false);
234238
$this->urlBuilder->expects($this->once())->method('getUrl')->with('paypal/billing_agreement/startWizard', []);
235239
$this->block->toHtml();
236240
}

app/code/Magento/Widget/Test/Unit/Block/Adminhtml/Widget/Instance/Edit/Chooser/ContainerTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public function testToHtmlCatalogProductsListGroupedProduct()
6767
. '<option value="content.top" >Main Content Top</option></select>';
6868

6969
$this->eventManagerMock->expects($this->exactly(2))->method('dispatch')->willReturn(true);
70+
$this->scopeConfigMock->expects($this->once())->method('getValue')->willReturn(false);
7071

7172
$this->themeCollectionFactoryMock->expects($this->once())
7273
->method('create')
@@ -153,6 +154,7 @@ public function testToHtmlCatalogCategoryLinkSimpleProduct()
153154
. '<option value="sidebar.main" >Sidebar Main</option></select>';
154155

155156
$this->eventManagerMock->expects($this->exactly(2))->method('dispatch')->willReturn(true);
157+
$this->scopeConfigMock->expects($this->once())->method('getValue')->willReturn(false);
156158

157159
$this->themeCollectionFactoryMock->expects($this->once())
158160
->method('create')
@@ -283,6 +285,7 @@ public function testToHtmlCmsStaticBlockAllProductTypes()
283285
. '<option value="sidebar.main" >Sidebar Main</option></select>';
284286

285287
$this->eventManagerMock->expects($this->exactly(2))->method('dispatch')->willReturn(true);
288+
$this->scopeConfigMock->expects($this->once())->method('getValue')->willReturn(false);
286289

287290
$this->themeCollectionFactoryMock->expects($this->once())
288291
->method('create')
@@ -400,6 +403,7 @@ public function testToHtmlOrderBySkuAllPages()
400403
. 'Sidebar Main</option></select>';
401404

402405
$this->eventManagerMock->expects($this->exactly(2))->method('dispatch')->willReturn(true);
406+
$this->scopeConfigMock->expects($this->once())->method('getValue')->willReturn(false);
403407

404408
$this->themeCollectionFactoryMock->expects($this->once())
405409
->method('create')

lib/internal/Magento/Framework/View/Element/AbstractBlock.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,6 @@ protected function _beforeToHtml()
650650
public function toHtml()
651651
{
652652
$this->_eventManager->dispatch('view_block_abstract_to_html_before', ['block' => $this]);
653-
$this->getModuleName();
654653

655654
$html = $this->_loadCache();
656655
if ($html === false) {

0 commit comments

Comments
 (0)