File tree Expand file tree Collapse file tree 10 files changed +70
-4
lines changed
Analytics/Test/Unit/Block/Adminhtml/System/Config
Config/Test/Unit/Block/System/Config/Form/Field
Customer/Test/Unit/Model/Renderer
OfflineShipping/Test/Unit/Block/Adminhtml/Form/Field
Paypal/Test/Unit/Block/Adminhtml/System/Config/Field/Enable Expand file tree Collapse file tree 10 files changed +70
-4
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,15 @@ protected function setUp()
39
39
->setMethods (['getComment ' , 'getLabel ' ])
40
40
->disableOriginalConstructor ()
41
41
->getMock ();
42
+
43
+ $ objectManager = new ObjectManager ($ this );
44
+ $ escaper = $ objectManager ->getObject (\Magento \Framework \Escaper::class);
45
+ $ reflection = new \ReflectionClass ($ this ->abstractElementMock );
46
+ $ reflection_property = $ reflection ->getProperty ('_escaper ' );
47
+ $ reflection_property ->setAccessible (true );
48
+ $ reflection_property ->setValue ($ this ->abstractElementMock , $ escaper );
49
+
50
+ $ this ->abstractElementMock ->setEscaper ($ escaper );
42
51
$ this ->contextMock = $ this ->getMockBuilder (Context::class)
43
52
->disableOriginalConstructor ()
44
53
->getMock ();
Original file line number Diff line number Diff line change @@ -46,6 +46,14 @@ protected function setUp()
46
46
->setMethods (['getComment ' ])
47
47
->disableOriginalConstructor ()
48
48
->getMock ();
49
+
50
+ $ objectManager = new ObjectManager ($ this );
51
+ $ escaper = $ objectManager ->getObject (\Magento \Framework \Escaper::class);
52
+ $ reflection = new \ReflectionClass ($ this ->abstractElementMock );
53
+ $ reflection_property = $ reflection ->getProperty ('_escaper ' );
54
+ $ reflection_property ->setAccessible (true );
55
+ $ reflection_property ->setValue ($ this ->abstractElementMock , $ escaper );
56
+
49
57
$ this ->contextMock = $ this ->getMockBuilder (Context::class)
50
58
->setMethods (['getLocaleDate ' ])
51
59
->disableOriginalConstructor ()
Original file line number Diff line number Diff line change @@ -51,6 +51,14 @@ protected function setUp()
51
51
->setMethods (['getComment ' ])
52
52
->disableOriginalConstructor ()
53
53
->getMock ();
54
+
55
+ $ objectManager = new ObjectManager ($ this );
56
+ $ escaper = $ objectManager ->getObject (\Magento \Framework \Escaper::class);
57
+ $ reflection = new \ReflectionClass ($ this ->abstractElementMock );
58
+ $ reflection_property = $ reflection ->getProperty ('_escaper ' );
59
+ $ reflection_property ->setAccessible (true );
60
+ $ reflection_property ->setValue ($ this ->abstractElementMock , $ escaper );
61
+
54
62
$ this ->formMock = $ this ->getMockBuilder (Form::class)
55
63
->disableOriginalConstructor ()
56
64
->getMock ();
Original file line number Diff line number Diff line change @@ -39,6 +39,14 @@ protected function setUp()
39
39
->setMethods (['getComment ' , 'getLabel ' , 'getHint ' ])
40
40
->disableOriginalConstructor ()
41
41
->getMock ();
42
+
43
+ $ objectManager = new ObjectManager ($ this );
44
+ $ escaper = $ objectManager ->getObject (\Magento \Framework \Escaper::class);
45
+ $ reflection = new \ReflectionClass ($ this ->abstractElementMock );
46
+ $ reflection_property = $ reflection ->getProperty ('_escaper ' );
47
+ $ reflection_property ->setAccessible (true );
48
+ $ reflection_property ->setValue ($ this ->abstractElementMock , $ escaper );
49
+
42
50
$ this ->contextMock = $ this ->getMockBuilder (Context::class)
43
51
->disableOriginalConstructor ()
44
52
->getMock ();
Original file line number Diff line number Diff line change @@ -40,7 +40,11 @@ protected function setUp()
40
40
41
41
$ this ->file = $ objectManager ->getObject (
42
42
\Magento \Config \Block \System \Config \Form \Field \File::class,
43
- ['data ' => $ this ->testData ]
43
+ [
44
+ '_escaper ' => $ objectManager ->getObject (\Magento \Framework \Escaper::class),
45
+ 'data ' => $ this ->testData ,
46
+
47
+ ]
44
48
);
45
49
46
50
$ formMock = new \Magento \Framework \DataObject ();
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ protected function setUp()
34
34
\Magento \Config \Block \System \Config \Form \Field \Image::class,
35
35
[
36
36
'urlBuilder ' => $ this ->urlBuilderMock ,
37
+ '_escaper ' => $ objectManager ->getObject (\Magento \Framework \Escaper::class)
37
38
]
38
39
);
39
40
Original file line number Diff line number Diff line change @@ -21,7 +21,10 @@ protected function setUp()
21
21
{
22
22
$ testHelper = new \Magento \Framework \TestFramework \Unit \Helper \ObjectManager ($ this );
23
23
$ this ->_object = $ testHelper ->getObject (
24
- \Magento \Config \Block \System \Config \Form \Field \Select \Allowspecific::class
24
+ \Magento \Config \Block \System \Config \Form \Field \Select \Allowspecific::class,
25
+ [
26
+ '_escaper ' => $ testHelper ->getObject (\Magento \Framework \Escaper::class)
27
+ ]
25
28
);
26
29
$ this ->_object ->setData ('html_id ' , 'spec_element ' );
27
30
$ this ->_formMock = $ this ->createPartialMock (
Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento \Customer \Test \Unit \Model \Renderer ;
7
7
8
+ use Magento \Framework \TestFramework \Unit \Helper \ObjectManager ;
9
+
8
10
class RegionTest extends \PHPUnit \Framework \TestCase
9
11
{
10
12
/**
@@ -58,6 +60,14 @@ public function testRender($regionCollection)
58
60
]
59
61
)
60
62
);
63
+
64
+ $ objectManager = new ObjectManager ($ this );
65
+ $ escaper = $ objectManager ->getObject (\Magento \Framework \Escaper::class);
66
+ $ reflection = new \ReflectionClass ($ elementMock );
67
+ $ reflection_property = $ reflection ->getProperty ('_escaper ' );
68
+ $ reflection_property ->setAccessible (true );
69
+ $ reflection_property ->setValue ($ elementMock , $ escaper );
70
+
61
71
$ formMock ->expects (
62
72
$ this ->any ()
63
73
)->method (
Original file line number Diff line number Diff line change @@ -33,7 +33,10 @@ protected function setUp()
33
33
$ testHelper = new \Magento \Framework \TestFramework \Unit \Helper \ObjectManager ($ this );
34
34
$ this ->_object = $ testHelper ->getObject (
35
35
\Magento \OfflineShipping \Block \Adminhtml \Form \Field \Import::class,
36
- ['data ' => $ testData ]
36
+ [
37
+ 'data ' => $ testData ,
38
+ '_escaper ' => $ testHelper ->getObject (\Magento \Framework \Escaper::class)
39
+ ]
37
40
);
38
41
$ this ->_object ->setForm ($ this ->_formMock );
39
42
}
Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento \Paypal \Test \Unit \Block \Adminhtml \System \Config \Field \Enable ;
7
7
8
+ use Magento \Framework \TestFramework \Unit \Helper \ObjectManager ;
9
+
8
10
/**
9
11
* Class AbstractEnableTest
10
12
*
@@ -43,8 +45,18 @@ protected function setUp()
43
45
)->disableOriginalConstructor ()
44
46
->getMockForAbstractClass ();
45
47
48
+ $ objectManager = new ObjectManager ($ this );
49
+ $ escaper = $ objectManager ->getObject (\Magento \Framework \Escaper::class);
50
+ $ reflection = new \ReflectionClass ($ this ->elementMock );
51
+ $ reflection_property = $ reflection ->getProperty ('_escaper ' );
52
+ $ reflection_property ->setAccessible (true );
53
+ $ reflection_property ->setValue ($ this ->elementMock , $ escaper );
54
+
46
55
$ this ->abstractEnable = $ objectManager ->getObject (
47
- \Magento \Paypal \Test \Unit \Block \Adminhtml \System \Config \Field \Enable \AbstractEnable \Stub::class
56
+ \Magento \Paypal \Test \Unit \Block \Adminhtml \System \Config \Field \Enable \AbstractEnable \Stub::class,
57
+ [
58
+ '_escaper ' => $ objectManager ->getObject (\Magento \Framework \Escaper::class)
59
+ ]
48
60
);
49
61
}
50
62
You can’t perform that action at this time.
0 commit comments