From 2ec1d7403e140640e0e8f29232a5ce8faa27cabc Mon Sep 17 00:00:00 2001 From: Oleh Posyniak <oposyniak@magento.com> Date: Thu, 29 Dec 2016 11:06:03 +0200 Subject: [PATCH] MAGETWO-62710: Remove Advanced section --- .../Unit/Block/Adminhtml/Product/Options/AjaxTest.php | 8 -------- .../Test/Unit/Block/Product/Widget/NewWidgetTest.php | 2 -- .../Test/Unit/Block/Cart/Item/Renderer/ActionsTest.php | 4 ---- .../Payment/Test/Unit/Block/Info/SubstitutionTest.php | 3 ++- .../Paypal/Test/Unit/Block/Billing/AgreementsTest.php | 4 ---- .../Widget/Instance/Edit/Chooser/ContainerTest.php | 4 ---- .../Magento/Framework/View/Element/AbstractBlock.php | 1 + 7 files changed, 3 insertions(+), 23 deletions(-) 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 42f588eb47c..885b3cc6964 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 a42f3354f98..768d70e8e1f 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 c3908bbad77..fc5d748804f 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 9e32ec2a37e..fb8865a1d7e 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 11527bbe8c4..4c535c3f44b 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 47f4507d7e2..d1a7b17e8bd 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 779c24118f7..2c084100b99 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) { -- GitLab