Skip to content

Commit f490772

Browse files
author
Volodymyr Kublytskyi
committed
MAGETWO-62669: [Backport] [GITHUB] 3rd party payment gateways not visible in adminhtml anymore on 2.1.3 #7891 - 2.1.4
- fixed failed unit test due to incorrect mock of section modifier
1 parent 53492d5 commit f490772

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

app/code/Magento/Paypal/Test/Unit/Model/Config/StructurePluginTest.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace Magento\Paypal\Test\Unit\Model\Config;
88

9+
use Magento\Paypal\Model\Config\Structure\PaymentSectionModifier;
910
use Magento\Paypal\Model\Config\StructurePlugin;
1011
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
1112

@@ -20,15 +21,27 @@ class StructurePluginTest extends \PHPUnit_Framework_TestCase
2021
/** @var \Magento\Paypal\Helper\Backend|\PHPUnit_Framework_MockObject_MockObject */
2122
protected $_helper;
2223

24+
/**
25+
* @var PaymentSectionModifier
26+
*/
27+
private $paymentSectionModifier;
28+
2329
protected function setUp()
2430
{
2531
$this->_scopeDefiner = $this->getMock('Magento\Config\Model\Config\ScopeDefiner', [], [], '', false);
2632
$this->_helper = $this->getMock('Magento\Paypal\Helper\Backend', [], [], '', false);
2733

34+
$this->paymentSectionModifier = $this->getMockBuilder(PaymentSectionModifier::class)->getMock();
35+
36+
2837
$objectManagerHelper = new ObjectManagerHelper($this);
2938
$this->_model = $objectManagerHelper->getObject(
3039
'Magento\Paypal\Model\Config\StructurePlugin',
31-
['scopeDefiner' => $this->_scopeDefiner, 'helper' => $this->_helper]
40+
[
41+
'scopeDefiner' => $this->_scopeDefiner,
42+
'helper' => $this->_helper,
43+
'paymentSectionModifier' => $this->paymentSectionModifier,
44+
]
3245
);
3346
}
3447

@@ -145,6 +158,7 @@ public function testAroundGetSectionByPathParts($pathParts, $countryCode, $expec
145158
$self->_scopeDefiner->expects($self->any())
146159
->method('getScope')
147160
->will($self->returnValue($scope));
161+
$this->paymentSectionModifier->method('modify')->willReturn($sectionMap);
148162
$result->expects($self->at(0))
149163
->method('getData')
150164
->will($self->returnValue(['children' => []]));

0 commit comments

Comments
 (0)