diff --git a/tests/WP_Ultimo/Models/Membership_Test.php b/tests/WP_Ultimo/Models/Membership_Test.php index 8eda9c21..88eea412 100644 --- a/tests/WP_Ultimo/Models/Membership_Test.php +++ b/tests/WP_Ultimo/Models/Membership_Test.php @@ -1091,23 +1091,23 @@ public function test_swap_replaces_plan_for_registered_custom_plan_type(): void add_filter('wu_plan_product_types', $register_network_type); - $network_product = new Product( + $network_product = wu_create_product( [ - 'name' => 'Network Plan', - 'slug' => 'network-plan-' . wp_generate_password(6, false), - 'description' => 'A custom plan type registered by an addon', - 'pricing_type' => 'paid', - 'amount' => 49.00, - 'currency' => 'USD', - 'duration' => 1, - 'duration_unit' => 'month', - 'type' => 'network', - 'recurring' => true, - 'active' => true, + 'name' => 'Network Plan', + 'slug' => 'network-plan-' . wp_generate_password(6, false), + 'description' => 'A custom plan type registered by an addon', + 'pricing_type' => 'paid', + 'amount' => 49.00, + 'currency' => 'USD', + 'duration' => 1, + 'duration_unit' => 'month', + 'type' => 'network', + 'recurring' => true, + 'active' => true, + 'skip_validation' => true, ] ); - $network_product->set_skip_validation(true); - $network_product->save(); + $this->assertNotWPError($network_product); $cart = new \WP_Ultimo\Checkout\Cart( [ @@ -1451,7 +1451,7 @@ public function test_renew_preserves_cancellation_date_on_active_renewal(): void /** * Test renew() DOES clear date_cancellation when reactivating a cancelled membership. * - * renew() is called by reactivate(), and also directly by gateways via IPN/webhook. + * Renew() is called by reactivate(), and also directly by gateways via IPN/webhook. * It must clear the cancellation timestamp when the previous status was CANCELLED * so that cancelled membership records are cleaned up in a single save. */