@@ -81,7 +81,8 @@ public function set_up() {
81
81
}
82
82
83
83
$ this ->stripe_api = $ this ->createMock ( WC_Stripe_API::class );
84
- $ this ->controller = new WC_REST_Stripe_Settings_Controller ( $ this ->get_gateway (), $ this ->stripe_api );
84
+ WC_Stripe_API::set_instance ( $ this ->stripe_api );
85
+ $ this ->controller = new WC_REST_Stripe_Settings_Controller ( $ this ->get_gateway () );
85
86
86
87
add_action ( 'rest_api_init ' , [ $ this , 'deregister_wc_blocks_rest_api ' ], 5 );
87
88
@@ -165,28 +166,35 @@ public function test_update_stripe_payment_method_configurations_settings() {
165
166
],
166
167
);
167
168
168
- $ this ->stripe_api ->method ( 'update_payment_method_configurations ' )->with (
169
+ $ this ->stripe_api ->expects ( $ this -> once () )-> method ( 'update_payment_method_configurations ' )->with (
169
170
$ this ->equalTo ( 'pmc_abcdef ' ),
170
171
$ this ->equalTo (
171
172
[
172
173
'amazon_pay ' => [
173
- 'display_preference ' => ( object ) [ 'value ' => 'on ' ],
174
+ 'display_preference ' => [ 'preference ' => 'on ' ],
174
175
],
175
176
'card ' => [
176
- 'display_preference ' => ( object ) [ 'value ' => 'on ' ],
177
+ 'display_preference ' => [ 'preference ' => 'on ' ],
177
178
],
178
- 'boleto ' => [
179
- 'display_preference ' => ( object ) [ 'preference ' => 'on ' ],
179
+ 'us_bank_account ' => [
180
+ 'display_preference ' => [ 'preference ' => 'off ' ],
180
181
],
181
- 'link ' => [
182
- 'display_preference ' => (object ) [ 'preference ' => 'off ' ],
182
+ 'affirm ' => [
183
+ 'display_preference ' => [ 'preference ' => 'off ' ],
184
+ ],
185
+ 'afterpay_clearpay ' => [
186
+ 'display_preference ' => [ 'preference ' => 'off ' ],
187
+ ],
188
+ 'cashapp ' => [
189
+ 'display_preference ' => [ 'preference ' => 'off ' ],
183
190
],
184
191
]
185
192
),
186
193
);
187
194
188
195
$ request = new WP_REST_Request ( 'POST ' , self ::SETTINGS_ROUTE );
189
196
$ request ->set_param ( 'enabled_payment_method_ids ' , [ 'amazon_pay ' , 'card ' ] );
197
+ $ request ->set_param ( 'is_upe_enabled ' , true );
190
198
191
199
$ response = $ this ->controller ->update_settings ( $ request );
192
200
$ this ->assertEquals ( 200 , $ response ->get_status () );
0 commit comments