diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Options/AjaxTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Options/AjaxTest.php index 42f588eb47c98891e81dde579572ff79a95b7c79..885b3cc69640bd760509722c06d1628cd7b05396 100644 --- a/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Options/AjaxTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Options/AjaxTest.php @@ -55,12 +55,6 @@ class AjaxTest extends \PHPUnit_Framework_TestCase ->getMock(); $eventManager->expects($this->exactly(2))->method('dispatch')->will($this->returnValue(true)); - $scopeConfig = $this->getMockBuilder(\Magento\Framework\App\Config::class) - ->setMethods(['getValue']) - ->disableOriginalConstructor()->getMock(); - $scopeConfig->expects($this->once())->method('getValue')->withAnyParameters() - ->will($this->returnValue(false)); - $product = $this->getMockBuilder(\Magento\Catalog\Model\Product::class)->disableOriginalConstructor() ->setMethods(['setStoreId', 'load', 'getId', '__wakeup', '__sleep']) ->getMock(); @@ -93,8 +87,6 @@ class AjaxTest extends \PHPUnit_Framework_TestCase $this->context->expects($this->once())->method('getEventManager') ->will($this->returnValue($eventManager)); - $this->context->expects($this->once())->method('getScopeConfig') - ->will($this->returnValue($scopeConfig)); $this->context->expects($this->once())->method('getLayout') ->will($this->returnValue($layout)); $this->context->expects($this->once())->method('getRequest') diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Product/Widget/NewWidgetTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Product/Widget/NewWidgetTest.php index a42f3354f98e8c65fa2feb704145dfeb7cbf123f..768d70e8e1f76d50c836203c63386816dbd3a980 100644 --- a/app/code/Magento/Catalog/Test/Unit/Block/Product/Widget/NewWidgetTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Block/Product/Widget/NewWidgetTest.php @@ -188,8 +188,6 @@ class NewWidgetTest extends \PHPUnit_Framework_TestCase { $this->eventManager->expects($this->exactly(2))->method('dispatch') ->will($this->returnValue(true)); - $this->scopeConfig->expects($this->once())->method('getValue')->withAnyParameters() - ->willReturn(false); $this->cacheState->expects($this->atLeastOnce())->method('isEnabled')->withAnyParameters() ->willReturn(false); $this->catalogConfig->expects($this->once())->method('getProductAttributes') diff --git a/app/code/Magento/Checkout/Test/Unit/Block/Cart/Item/Renderer/ActionsTest.php b/app/code/Magento/Checkout/Test/Unit/Block/Cart/Item/Renderer/ActionsTest.php index c3908bbad779846410e7ba08a558f051fd3c2cf6..fc5d748804f95c0719545e8ab3ca2e05174cc63e 100644 --- a/app/code/Magento/Checkout/Test/Unit/Block/Cart/Item/Renderer/ActionsTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Block/Cart/Item/Renderer/ActionsTest.php @@ -65,10 +65,6 @@ class ActionsTest extends \PHPUnit_Framework_TestCase $childNameTwo = 'child.2'; $childNames = [$childNameOne, $childNameTwo]; - $this->scopeConfigMock->expects($this->once()) - ->method('getValue') - ->willReturn(false); - /** * @var Item|\PHPUnit_Framework_MockObject_MockObject $itemMock */ diff --git a/app/code/Magento/Payment/Test/Unit/Block/Info/SubstitutionTest.php b/app/code/Magento/Payment/Test/Unit/Block/Info/SubstitutionTest.php index 9e32ec2a37e360646d924ef19bbffcfd8e7b9487..fb8865a1d7e420735c220a9f2b54e4d07aeff3d0 100644 --- a/app/code/Magento/Payment/Test/Unit/Block/Info/SubstitutionTest.php +++ b/app/code/Magento/Payment/Test/Unit/Block/Info/SubstitutionTest.php @@ -90,7 +90,8 @@ class SubstitutionTest extends \PHPUnit_Framework_TestCase $this->layout->expects($this->any()) ->method('createBlock') ->with( - \Magento\Framework\View\Element\Template::class, '', + \Magento\Framework\View\Element\Template::class, + '', ['data' => ['method' => $methodMock, 'template' => 'Magento_Payment::info/substitution.phtml']] )->willReturn($fakeBlock); diff --git a/app/code/Magento/Paypal/Test/Unit/Block/Billing/AgreementsTest.php b/app/code/Magento/Paypal/Test/Unit/Block/Billing/AgreementsTest.php index 11527bbe8c441226a6e69ccbe6d1c57b94248f02..4c535c3f44b37a1eb477df22d0cf4d2837979475 100644 --- a/app/code/Magento/Paypal/Test/Unit/Block/Billing/AgreementsTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Block/Billing/AgreementsTest.php @@ -243,10 +243,6 @@ class AgreementsTest extends \PHPUnit_Framework_TestCase ->expects($this->at(1)) ->method('dispatch') ->with('view_block_abstract_to_html_after', ['block' => $this->block, 'transport' => $transport]); - $this->scopeConfig - ->expects($this->once()) - ->method('getValue') - ->willReturn(false); $this->urlBuilder->expects($this->once())->method('getUrl')->with('paypal/billing_agreement/startWizard', []); $this->block->toHtml(); } diff --git a/app/code/Magento/Widget/Test/Unit/Block/Adminhtml/Widget/Instance/Edit/Chooser/ContainerTest.php b/app/code/Magento/Widget/Test/Unit/Block/Adminhtml/Widget/Instance/Edit/Chooser/ContainerTest.php index 47f4507d7e2de8f532220877236809e1679d4202..d1a7b17e8bd4c03e262764f6e239b3201ad9f209 100644 --- a/app/code/Magento/Widget/Test/Unit/Block/Adminhtml/Widget/Instance/Edit/Chooser/ContainerTest.php +++ b/app/code/Magento/Widget/Test/Unit/Block/Adminhtml/Widget/Instance/Edit/Chooser/ContainerTest.php @@ -67,7 +67,6 @@ class ContainerTest extends AbstractContainerTest . '<option value="content.top" >Main Content Top</option></select>'; $this->eventManagerMock->expects($this->exactly(2))->method('dispatch')->willReturn(true); - $this->scopeConfigMock->expects($this->once())->method('getValue')->willReturn(false); $this->themeCollectionFactoryMock->expects($this->once()) ->method('create') @@ -154,7 +153,6 @@ class ContainerTest extends AbstractContainerTest . '<option value="sidebar.main" >Sidebar Main</option></select>'; $this->eventManagerMock->expects($this->exactly(2))->method('dispatch')->willReturn(true); - $this->scopeConfigMock->expects($this->once())->method('getValue')->willReturn(false); $this->themeCollectionFactoryMock->expects($this->once()) ->method('create') @@ -285,7 +283,6 @@ class ContainerTest extends AbstractContainerTest . '<option value="sidebar.main" >Sidebar Main</option></select>'; $this->eventManagerMock->expects($this->exactly(2))->method('dispatch')->willReturn(true); - $this->scopeConfigMock->expects($this->once())->method('getValue')->willReturn(false); $this->themeCollectionFactoryMock->expects($this->once()) ->method('create') @@ -403,7 +400,6 @@ class ContainerTest extends AbstractContainerTest . 'Sidebar Main</option></select>'; $this->eventManagerMock->expects($this->exactly(2))->method('dispatch')->willReturn(true); - $this->scopeConfigMock->expects($this->once())->method('getValue')->willReturn(false); $this->themeCollectionFactoryMock->expects($this->once()) ->method('create') diff --git a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php index 779c24118f794379c548f3bf0395940b0caef6b5..2c084100b99223eaba74a9115bd90e5b4a55caba 100644 --- a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php +++ b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php @@ -647,6 +647,7 @@ abstract class AbstractBlock extends \Magento\Framework\DataObject implements Bl public function toHtml() { $this->_eventManager->dispatch('view_block_abstract_to_html_before', ['block' => $this]); + $this->getModuleName(); $html = $this->_loadCache(); if ($html === false) {