Skip to content

Commit f4c6719

Browse files
committed
Update payment method configuration tests after #4415 (#4419)
1 parent bb6b12a commit f4c6719

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

tests/phpunit/test-class-wc-stripe-payment-method-configurations.php

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,33 @@ class WC_Stripe_Payment_Method_Configurations_Test extends WP_UnitTestCase {
99
* @return void
1010
*/
1111
public function test_get_parent_configuration_id() {
12-
$this->assertNull( WC_Stripe_Payment_Method_Configurations::get_parent_configuration_id() );
12+
$initial_settings = WC_Stripe_Helper::get_stripe_settings();
13+
14+
WC_Stripe_Helper::update_main_stripe_settings(
15+
array_merge(
16+
$initial_settings,
17+
[ 'testmode' => 'yes' ]
18+
)
19+
);
20+
21+
$this->assertEquals(
22+
WC_Stripe_Payment_Method_Configurations::TEST_MODE_CONFIGURATION_PARENT_ID,
23+
WC_Stripe_Payment_Method_Configurations::get_parent_configuration_id()
24+
);
25+
26+
WC_Stripe_Helper::update_main_stripe_settings(
27+
array_merge(
28+
$initial_settings,
29+
[ 'testmode' => 'no' ]
30+
)
31+
);
32+
33+
$this->assertEquals(
34+
WC_Stripe_Payment_Method_Configurations::LIVE_MODE_CONFIGURATION_PARENT_ID,
35+
WC_Stripe_Payment_Method_Configurations::get_parent_configuration_id()
36+
);
37+
38+
WC_Stripe_Helper::update_main_stripe_settings( $initial_settings );
1339
}
1440

1541
/**

0 commit comments

Comments
 (0)