6
6
namespace Magento \Paypal \Model \Api ;
7
7
8
8
use Magento \Framework \Api \SearchCriteriaBuilder ;
9
+ use Magento \Framework \App \ProductMetadataInterface ;
9
10
use Magento \Framework \HTTP \Adapter \Curl ;
10
11
use Magento \Framework \HTTP \Adapter \CurlFactory ;
11
12
use Magento \Framework \ObjectManagerInterface ;
12
13
use Magento \Paypal \Model \CartFactory ;
14
+ use Magento \Paypal \Model \Config ;
13
15
use Magento \Quote \Model \Quote ;
14
16
use Magento \Quote \Model \QuoteRepository ;
15
17
use Magento \TestFramework \Helper \Bootstrap ;
16
18
use PHPUnit_Framework_MockObject_MockObject as MockObject ;
17
- use Magento \Paypal \Model \Config ;
18
19
19
20
class PayflowNvpTest extends \PHPUnit_Framework_TestCase
20
21
{
@@ -55,9 +56,21 @@ protected function setUp()
55
56
'curlFactory ' => $ httpFactory
56
57
]);
57
58
59
+ /** @var ProductMetadataInterface|MockObject $productMetadata */
60
+ $ productMetadata = $ this ->getMockBuilder (ProductMetadataInterface::class)
61
+ ->getMock ();
62
+ $ productMetadata ->method ('getEdition ' )
63
+ ->willReturn ('' );
64
+
58
65
/** @var Config $config */
59
66
$ config = $ this ->objectManager ->get (Config::class);
60
67
$ config ->setMethodCode (Config::METHOD_WPP_PE_EXPRESS );
68
+
69
+ $ refObject = new \ReflectionObject ($ config );
70
+ $ refProperty = $ refObject ->getProperty ('productMetadata ' );
71
+ $ refProperty ->setAccessible (true );
72
+ $ refProperty ->setValue ($ config , $ productMetadata );
73
+
61
74
$ this ->nvpApi ->setConfigObject ($ config );
62
75
}
63
76
@@ -78,7 +91,7 @@ public function testRequestLineItems()
78
91
. 'L_NAME1=Simple 2&L_QTY1=2&L_COST1=9.69& '
79
92
. 'L_NAME2=Simple 3&L_QTY2=3&L_COST2=11.69& '
80
93
. 'L_NAME3=Discount&L_QTY3=1&L_COST3=-10.00& '
81
- . 'TRXTYPE=A&ACTION=S&BUTTONSOURCE=Magento_Cart_Community ' ;
94
+ . 'TRXTYPE=A&ACTION=S&BUTTONSOURCE=Magento_Cart_ ' ;
82
95
83
96
$ this ->httpClient ->method ('write ' )
84
97
->with (
0 commit comments