Fix failing to update onboarding profile data for PHP 8 (#34832)
* Fix failing to update industries * Add changelog * Update changelog * Update onboarding profile unit tests to test all schema fields
This commit is contained in:
parent
c0fe3ec18f
commit
ab484e579b
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Fix failing to update onboarding profile data for PHP 8
|
|
@ -443,7 +443,7 @@ class OnboardingProfile extends \WC_REST_Data_Controller {
|
|||
'description' => __( 'Whether or not this store country is set via onboarding profiler.', 'woocommerce' ),
|
||||
'context' => array( 'view' ),
|
||||
'readonly' => true,
|
||||
'validate_callback' => array( __CLASS__, 'rest_validate_request_arg' ),
|
||||
'validate_callback' => 'rest_validate_request_arg',
|
||||
),
|
||||
);
|
||||
|
||||
|
|
|
@ -67,7 +67,31 @@ class WC_Admin_Tests_API_Onboarding_Profiles extends WC_REST_Unit_Test_Case {
|
|||
'slug' => 'health-beauty',
|
||||
),
|
||||
);
|
||||
$request->set_body( wp_json_encode( array( 'industry' => $industry ) ) );
|
||||
$request->set_body(
|
||||
wp_json_encode(
|
||||
array(
|
||||
'completed' => true,
|
||||
'skipped' => false,
|
||||
'industry' => $industry,
|
||||
'product_types' => 'physical',
|
||||
'product_count' => '1-10',
|
||||
'selling_venues' => 'brick-mortar',
|
||||
'number_employees' => '<10',
|
||||
'revenue' => 'none',
|
||||
'other_platform' => 'shopify',
|
||||
'other_platform_name' => '',
|
||||
'business_extensions' => array(
|
||||
'jetpack',
|
||||
),
|
||||
'theme' => 'Test',
|
||||
'wccom_connected' => false,
|
||||
'setup_client' => false,
|
||||
'is_agree_marketing' => true,
|
||||
'store_email' => 'user@example.com',
|
||||
'is_store_country_set' => true,
|
||||
)
|
||||
)
|
||||
);
|
||||
$response = $this->server->dispatch( $request );
|
||||
$data = $response->get_data();
|
||||
|
||||
|
|
Loading…
Reference in New Issue