@@ -126,11 +126,9 @@ public function testBeforeSavePaymentInformationAndPlaceOrder()
126126 ->willReturn (true );
127127 $ searchCriteriaMock = $ this ->createMock (SearchCriteria::class);
128128 $ this ->quoteMock
129- ->expects ($ this ->once ())
130129 ->method ('getIsMultiShipping ' )
131130 ->willReturn (false );
132131 $ this ->quoteRepositoryMock
133- ->expects ($ this ->once ())
134132 ->method ('getActive ' )
135133 ->with ($ cartId )
136134 ->willReturn ($ this ->quoteMock );
@@ -146,7 +144,7 @@ public function testBeforeSavePaymentInformationAndPlaceOrder()
146144 $ this ->paymentMock ->expects (static ::atLeastOnce ())
147145 ->method ('getExtensionAttributes ' )
148146 ->willReturn ($ this ->extensionAttributesMock );
149- $ this ->model ->beforeSavePaymentInformation (
147+ $ this ->model ->beforeSavePaymentInformationAndPlaceOrder (
150148 $ this ->subjectMock ,
151149 $ cartId ,
152150 $ this ->paymentMock ,
@@ -166,11 +164,9 @@ public function testBeforeSavePaymentInformationAndPlaceOrderIfAgreementsNotVali
166164 ->willReturn (true );
167165 $ searchCriteriaMock = $ this ->createMock (SearchCriteria::class);
168166 $ this ->quoteMock
169- ->expects ($ this ->once ())
170167 ->method ('getIsMultiShipping ' )
171168 ->willReturn (false );
172169 $ this ->quoteRepositoryMock
173- ->expects ($ this ->once ())
174170 ->method ('getActive ' )
175171 ->with ($ cartId )
176172 ->willReturn ($ this ->quoteMock );
@@ -186,7 +182,7 @@ public function testBeforeSavePaymentInformationAndPlaceOrderIfAgreementsNotVali
186182 $ this ->paymentMock ->expects (static ::atLeastOnce ())
187183 ->method ('getExtensionAttributes ' )
188184 ->willReturn ($ this ->extensionAttributesMock );
189- $ this ->model ->beforeSavePaymentInformation (
185+ $ this ->model ->beforeSavePaymentInformationAndPlaceOrder (
190186 $ this ->subjectMock ,
191187 $ cartId ,
192188 $ this ->paymentMock ,
@@ -198,40 +194,6 @@ public function testBeforeSavePaymentInformationAndPlaceOrderIfAgreementsNotVali
198194 );
199195 }
200196
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-
235197 /**
236198 * Build payment extension mock.
237199 *
0 commit comments