@@ -77,20 +77,31 @@ public function testGetCountry()
77
77
*/
78
78
public function testGetCountryForBillingAddressWithoutCountry ()
79
79
{
80
- $ address = $ this ->getMockBuilder (Address::class)
80
+ $ billingAddress = $ this ->getMockBuilder (Address::class)
81
+ ->disableOriginalConstructor ()
82
+ ->setMethods (['getCountry ' ])
83
+ ->getMock ();
84
+
85
+ $ shippingAddress = $ this ->getMockBuilder (Address::class)
81
86
->disableOriginalConstructor ()
82
87
->setMethods (['getCountry ' ])
83
88
->getMock ();
84
89
85
- $ this ->quote ->expects (static ::never ())
86
- ->method ('getShippingAddress ' );
90
+ $ this ->quote ->expects (static ::once ())
91
+ ->method ('getShippingAddress ' )
92
+ ->willReturn ($ shippingAddress );
87
93
$ this ->quote ->expects (static ::once ())
88
94
->method ('getBillingAddress ' )
89
- ->willReturn ($ address );
95
+ ->willReturn ($ billingAddress );
90
96
91
- $ address ->expects (static ::once ())
97
+ $ billingAddress ->expects (static ::once ())
98
+ ->method ('getCountry ' )
99
+ ->willReturn (null );
100
+
101
+ $ shippingAddress ->expects (static ::once ())
92
102
->method ('getCountry ' )
93
103
->willReturn (null );
104
+
94
105
$ this ->directory ->expects (static ::once ())
95
106
->method ('getDefaultCountry ' )
96
107
->willReturn ('US ' );
@@ -102,23 +113,32 @@ public function testGetCountryForBillingAddressWithoutCountry()
102
113
*/
103
114
public function testGetCountryShippingAddress ()
104
115
{
105
- $ address = $ this ->getMockBuilder (Address::class)
116
+ $ shippingAddress = $ this ->getMockBuilder (Address::class)
117
+ ->disableOriginalConstructor ()
118
+ ->setMethods (['getCountry ' ])
119
+ ->getMock ();
120
+
121
+ $ billingAddress = $ this ->getMockBuilder (Address::class)
106
122
->disableOriginalConstructor ()
107
123
->setMethods (['getCountry ' ])
108
124
->getMock ();
109
125
110
126
$ this ->quote ->expects (static ::once ())
111
127
->method ('getBillingAddress ' )
112
- ->willReturn (null );
128
+ ->willReturn ($ billingAddress );
113
129
114
130
$ this ->quote ->expects (static ::once ())
115
131
->method ('getShippingAddress ' )
116
- ->willReturn ($ address );
132
+ ->willReturn ($ shippingAddress );
117
133
118
- $ address ->expects (static ::once ())
134
+ $ shippingAddress ->expects (static ::once ())
119
135
->method ('getCountry ' )
120
136
->willReturn ('CA ' );
121
137
138
+ $ shippingAddress ->expects (static ::once ())
139
+ ->method ('getCountry ' )
140
+ ->willReturn (null );
141
+
122
142
$ this ->directory ->expects (static ::never ())
123
143
->method ('getDefaultCountry ' );
124
144
0 commit comments