Skip to content

Commit fd10ab5

Browse files
committed
MAGETWO-97247: Impossible to enable shared catalog through cli command
1 parent 7882b71 commit fd10ab5

File tree

2 files changed

+5
-33
lines changed

2 files changed

+5
-33
lines changed

app/code/Magento/Paypal/Model/Config/Structure/Element/FieldPlugin.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66
namespace Magento\Paypal\Model\Config\Structure\Element;
77

8-
use Magento\Framework\App\RequestInterface;
98
use Magento\Config\Model\Config\Structure\Element\Field as FieldConfigStructure;
109
use Magento\Paypal\Model\Config\StructurePlugin as ConfigStructurePlugin;
1110

@@ -14,19 +13,6 @@
1413
*/
1514
class FieldPlugin
1615
{
17-
/**
18-
* @var RequestInterface
19-
*/
20-
private $request;
21-
22-
/**
23-
* @param RequestInterface $request
24-
*/
25-
public function __construct(RequestInterface $request)
26-
{
27-
$this->request = $request;
28-
}
29-
3016
/**
3117
* Get original configPath (not changed by PayPal configuration inheritance)
3218
*

app/code/Magento/Paypal/Test/Unit/Model/Config/Structure/Element/FieldPluginTest.php

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
use Magento\Paypal\Model\Config\Structure\Element\FieldPlugin as FieldConfigStructurePlugin;
99
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
10-
use Magento\Framework\App\RequestInterface;
1110
use Magento\Config\Model\Config\Structure\Element\Field as FieldConfigStructureMock;
1211

1312
class FieldPluginTest extends \PHPUnit\Framework\TestCase
@@ -22,28 +21,20 @@ class FieldPluginTest extends \PHPUnit\Framework\TestCase
2221
*/
2322
private $objectManagerHelper;
2423

25-
/**
26-
* @var RequestInterface|\PHPUnit_Framework_MockObject_MockObject
27-
*/
28-
private $requestMock;
29-
3024
/**
3125
* @var FieldConfigStructureMock|\PHPUnit_Framework_MockObject_MockObject
3226
*/
3327
private $subjectMock;
3428

3529
protected function setUp()
3630
{
37-
$this->requestMock = $this->getMockBuilder(RequestInterface::class)
38-
->getMockForAbstractClass();
3931
$this->subjectMock = $this->getMockBuilder(FieldConfigStructureMock::class)
4032
->disableOriginalConstructor()
4133
->getMock();
4234

4335
$this->objectManagerHelper = new ObjectManagerHelper($this);
4436
$this->plugin = $this->objectManagerHelper->getObject(
45-
FieldConfigStructurePlugin::class,
46-
['request' => $this->requestMock]
37+
FieldConfigStructurePlugin::class
4738
);
4839
}
4940

@@ -56,10 +47,9 @@ public function testAroundGetConfigPathHasResult()
5647

5748
public function testAroundGetConfigPathNonPaymentSection()
5849
{
59-
$this->requestMock->expects(static::once())
60-
->method('getParam')
61-
->with('section')
62-
->willReturn('non-payment');
50+
$this->subjectMock->expects($this->once())
51+
->method('getPath')
52+
->willReturn('non-payment/group/field');
6353

6454
$this->assertNull($this->plugin->afterGetConfigPath($this->subjectMock, null));
6555
}
@@ -72,11 +62,7 @@ public function testAroundGetConfigPathNonPaymentSection()
7262
*/
7363
public function testAroundGetConfigPath($subjectPath, $expectedConfigPath)
7464
{
75-
$this->requestMock->expects(static::once())
76-
->method('getParam')
77-
->with('section')
78-
->willReturn('payment');
79-
$this->subjectMock->expects(static::once())
65+
$this->subjectMock->expects($this->exactly(2))
8066
->method('getPath')
8167
->willReturn($subjectPath);
8268

0 commit comments

Comments
 (0)