6
6
7
7
namespace Magento \Paypal \Test \Unit \Model \Config ;
8
8
9
+ use Magento \Paypal \Model \Config \Structure \PaymentSectionModifier ;
9
10
use Magento \Paypal \Model \Config \StructurePlugin ;
10
11
use Magento \Framework \TestFramework \Unit \Helper \ObjectManager as ObjectManagerHelper ;
11
12
@@ -20,15 +21,27 @@ class StructurePluginTest extends \PHPUnit_Framework_TestCase
20
21
/** @var \Magento\Paypal\Helper\Backend|\PHPUnit_Framework_MockObject_MockObject */
21
22
protected $ _helper ;
22
23
24
+ /**
25
+ * @var PaymentSectionModifier
26
+ */
27
+ private $ paymentSectionModifier ;
28
+
23
29
protected function setUp ()
24
30
{
25
31
$ this ->_scopeDefiner = $ this ->getMock ('Magento\Config\Model\Config\ScopeDefiner ' , [], [], '' , false );
26
32
$ this ->_helper = $ this ->getMock ('Magento\Paypal\Helper\Backend ' , [], [], '' , false );
27
33
34
+ $ this ->paymentSectionModifier = $ this ->getMockBuilder (PaymentSectionModifier::class)->getMock ();
35
+
36
+
28
37
$ objectManagerHelper = new ObjectManagerHelper ($ this );
29
38
$ this ->_model = $ objectManagerHelper ->getObject (
30
39
'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
+ ]
32
45
);
33
46
}
34
47
@@ -145,6 +158,7 @@ public function testAroundGetSectionByPathParts($pathParts, $countryCode, $expec
145
158
$ self ->_scopeDefiner ->expects ($ self ->any ())
146
159
->method ('getScope ' )
147
160
->will ($ self ->returnValue ($ scope ));
161
+ $ this ->paymentSectionModifier ->method ('modify ' )->willReturn ($ sectionMap );
148
162
$ result ->expects ($ self ->at (0 ))
149
163
->method ('getData ' )
150
164
->will ($ self ->returnValue (['children ' => []]));
0 commit comments