File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
app/code/Magento/Customer Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -25,12 +25,12 @@ class CustomerScopeData extends \Magento\Framework\View\Element\Template
25
25
private $ serializer ;
26
26
27
27
/**
28
- * CustomerScopeData constructor.
29
28
* @param \Magento\Framework\View\Element\Template\Context $context
30
29
* @param \Magento\Framework\Json\EncoderInterface $jsonEncoder
31
30
* @param array $data
32
31
* @param \Magento\Framework\Serialize\Serializer\Json|null $serializer
33
32
* @throws \RuntimeException
33
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
34
34
*/
35
35
public function __construct (
36
36
\Magento \Framework \View \Element \Template \Context $ context ,
Original file line number Diff line number Diff line change 10
10
use Magento \Store \Api \Data \StoreInterface ;
11
11
use Magento \Store \Model \StoreManagerInterface ;
12
12
use Magento \Customer \Block \CustomerScopeData ;
13
- use Magento \Framework \Json \EncoderInterface ;
14
13
15
14
class CustomerScopeDataTest extends \PHPUnit_Framework_TestCase
16
15
{
@@ -26,6 +25,9 @@ class CustomerScopeDataTest extends \PHPUnit_Framework_TestCase
26
25
/** @var ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject */
27
26
private $ scopeConfigMock ;
28
27
28
+ /** @var \Magento\Framework\Json\EncoderInterface|\PHPUnit_Framework_MockObject_MockObject */
29
+ private $ encoderMock ;
30
+
29
31
/** @var \Magento\Framework\Serialize\Serializer\Json|\PHPUnit_Framework_MockObject_MockObject */
30
32
private $ serializerMock ;
31
33
@@ -41,6 +43,9 @@ protected function setUp()
41
43
$ this ->scopeConfigMock = $ this ->getMockBuilder (ScopeConfigInterface::class)
42
44
->getMock ();
43
45
46
+ $ this ->encoderMock = $ this ->getMockBuilder (\Magento \Framework \Json \EncoderInterface::class)
47
+ ->getMock ();
48
+
44
49
$ this ->serializerMock = $ this ->getMockBuilder (\Magento \Framework \Serialize \Serializer \Json::class)
45
50
->getMock ();
46
51
@@ -54,7 +59,7 @@ protected function setUp()
54
59
55
60
$ this ->model = new CustomerScopeData (
56
61
$ this ->contextMock ,
57
- null ,
62
+ $ this -> encoderMock ,
58
63
[],
59
64
$ this ->serializerMock
60
65
);
You can’t perform that action at this time.
0 commit comments