@@ -126,11 +126,9 @@ public function testBeforeSavePaymentInformationAndPlaceOrder()
126
126
->willReturn (true );
127
127
$ searchCriteriaMock = $ this ->createMock (SearchCriteria::class);
128
128
$ this ->quoteMock
129
- ->expects ($ this ->once ())
130
129
->method ('getIsMultiShipping ' )
131
130
->willReturn (false );
132
131
$ this ->quoteRepositoryMock
133
- ->expects ($ this ->once ())
134
132
->method ('getActive ' )
135
133
->with ($ cartId )
136
134
->willReturn ($ this ->quoteMock );
@@ -146,7 +144,7 @@ public function testBeforeSavePaymentInformationAndPlaceOrder()
146
144
$ this ->paymentMock ->expects (static ::atLeastOnce ())
147
145
->method ('getExtensionAttributes ' )
148
146
->willReturn ($ this ->extensionAttributesMock );
149
- $ this ->model ->beforeSavePaymentInformation (
147
+ $ this ->model ->beforeSavePaymentInformationAndPlaceOrder (
150
148
$ this ->subjectMock ,
151
149
$ cartId ,
152
150
$ this ->paymentMock ,
@@ -166,11 +164,9 @@ public function testBeforeSavePaymentInformationAndPlaceOrderIfAgreementsNotVali
166
164
->willReturn (true );
167
165
$ searchCriteriaMock = $ this ->createMock (SearchCriteria::class);
168
166
$ this ->quoteMock
169
- ->expects ($ this ->once ())
170
167
->method ('getIsMultiShipping ' )
171
168
->willReturn (false );
172
169
$ this ->quoteRepositoryMock
173
- ->expects ($ this ->once ())
174
170
->method ('getActive ' )
175
171
->with ($ cartId )
176
172
->willReturn ($ this ->quoteMock );
@@ -186,7 +182,7 @@ public function testBeforeSavePaymentInformationAndPlaceOrderIfAgreementsNotVali
186
182
$ this ->paymentMock ->expects (static ::atLeastOnce ())
187
183
->method ('getExtensionAttributes ' )
188
184
->willReturn ($ this ->extensionAttributesMock );
189
- $ this ->model ->beforeSavePaymentInformation (
185
+ $ this ->model ->beforeSavePaymentInformationAndPlaceOrder (
190
186
$ this ->subjectMock ,
191
187
$ cartId ,
192
188
$ this ->paymentMock ,
@@ -198,40 +194,6 @@ public function testBeforeSavePaymentInformationAndPlaceOrderIfAgreementsNotVali
198
194
);
199
195
}
200
196
201
- public function testBeforeSavePaymentInformation ()
202
- {
203
- $ cartId = 100 ;
204
- $ agreements = [1 , 2 , 3 ];
205
- $ this ->scopeConfigMock
206
- ->expects ($ this ->once ())
207
- ->method ('isSetFlag ' )
208
- ->with (AgreementsProvider::PATH_ENABLED , ScopeInterface::SCOPE_STORE )
209
- ->willReturn (true );
210
- $ this ->quoteMock
211
- ->expects ($ this ->once ())
212
- ->method ('getIsMultiShipping ' )
213
- ->willReturn (false );
214
- $ this ->quoteRepositoryMock
215
- ->expects ($ this ->once ())
216
- ->method ('getActive ' )
217
- ->with ($ cartId )
218
- ->willReturn ($ this ->quoteMock );
219
- $ searchCriteriaMock = $ this ->createMock (SearchCriteria::class);
220
- $ this ->agreementsFilterMock ->expects ($ this ->once ())
221
- ->method ('buildSearchCriteria ' )
222
- ->willReturn ($ searchCriteriaMock );
223
- $ this ->checkoutAgreementsListMock ->expects ($ this ->once ())
224
- ->method ('getList ' )
225
- ->with ($ searchCriteriaMock )
226
- ->willReturn ([1 ]);
227
- $ this ->extensionAttributesMock ->expects ($ this ->once ())->method ('getAgreementIds ' )->willReturn ($ agreements );
228
- $ this ->agreementsValidatorMock ->expects ($ this ->once ())->method ('isValid ' )->with ($ agreements )->willReturn (true );
229
- $ this ->paymentMock ->expects (static ::atLeastOnce ())
230
- ->method ('getExtensionAttributes ' )
231
- ->willReturn ($ this ->extensionAttributesMock );
232
- $ this ->model ->beforeSavePaymentInformation ($ this ->subjectMock , $ cartId , $ this ->paymentMock , $ this ->addressMock );
233
- }
234
-
235
197
/**
236
198
* Build payment extension mock.
237
199
*
0 commit comments