Skip to content

Commit 6b444bb

Browse files
committed
MAGETWO-55935: [Bundle product] Cannot configure bundle product in order editing(admin panel)
1 parent cfa9a39 commit 6b444bb

File tree

1 file changed

+4
-15
lines changed
  • app/code/Magento/Bundle/Test/Unit/Block/Catalog/Product/View/Type

1 file changed

+4
-15
lines changed

app/code/Magento/Bundle/Test/Unit/Block/Catalog/Product/View/Type/BundleTest.php

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ class BundleTest extends \PHPUnit_Framework_TestCase
1919
/** @var \Magento\Bundle\Model\Product\PriceFactory|\PHPUnit_Framework_MockObject_MockObject */
2020
private $bundleProductPriceFactory;
2121

22-
/** @var \Magento\Catalog\Block\Product\Context|\PHPUnit_Framework_MockObject_MockObject */
23-
private $context;
24-
2522
/** @var \Magento\Framework\Json\Encoder|\PHPUnit_Framework_MockObject_MockObject */
2623
private $jsonEncoder;
2724

@@ -50,9 +47,6 @@ protected function setUp()
5047
->setMethods(['create'])
5148
->getMock();
5249

53-
$this->context = $this->getMockBuilder(\Magento\Catalog\Block\Product\Context::class)
54-
->disableOriginalConstructor()
55-
->getMock();
5650
$this->product = $this->getMockBuilder(\Magento\Catalog\Model\Product::class)
5751
->disableOriginalConstructor()
5852
->setMethods(
@@ -75,12 +69,6 @@ protected function setUp()
7569
$this->eventManager = $this->getMockBuilder(\Magento\Framework\Event\ManagerInterface::class)
7670
->disableOriginalConstructor()
7771
->getMock();
78-
$this->context->expects($this->any())
79-
->method('getEventManager')
80-
->willReturn($this->eventManager);
81-
$this->context->expects($this->any())
82-
->method('getRegistry')
83-
->willReturn($registry);
8472
$this->jsonEncoder = $this->getMockBuilder(\Magento\Framework\Json\Encoder::class)
8573
->disableOriginalConstructor()
8674
->getMock();
@@ -91,7 +79,8 @@ protected function setUp()
9179
$this->bundleBlock = $objectHelper->getObject(
9280
\Magento\Bundle\Block\Catalog\Product\View\Type\Bundle::class,
9381
[
94-
'context' => $this->context,
82+
'registry' => $registry,
83+
'eventManager' => $this->eventManager,
9584
'jsonEncoder' => $this->jsonEncoder,
9685
'productPrice' => $this->bundleProductPriceFactory,
9786
'catalogProduct' => $this->catalogProduct
@@ -105,7 +94,7 @@ public function testGetOptionHtmlNoRenderer()
10594
->setMethods(['getType'])
10695
->disableOriginalConstructor()
10796
->getMock();
108-
$option->expects($this->exactly(2))->method('getType')->willReturn('checkbox');
97+
$option->expects($this->any())->method('getType')->willReturn('checkbox');
10998

11099
$layout = $this->getMockBuilder(\Magento\Framework\View\Layout::class)
111100
->setMethods(['getChildName', 'getBlock'])
@@ -126,7 +115,7 @@ public function testGetOptionHtml()
126115
->setMethods(['getType'])
127116
->disableOriginalConstructor()
128117
->getMock();
129-
$option->expects($this->exactly(1))->method('getType')->willReturn('checkbox');
118+
$option->expects($this->once())->method('getType')->willReturn('checkbox');
130119

131120
$optionBlock = $this->getMockBuilder(
132121
\Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option\Checkbox::class

0 commit comments

Comments
 (0)