diff --git a/tests/legacy/unit-tests/rest-api/Tests/Version2/payment-gateways.php b/tests/legacy/unit-tests/rest-api/Tests/Version2/payment-gateways.php index 5b69b55494c..9efbcc582b0 100644 --- a/tests/legacy/unit-tests/rest-api/Tests/Version2/payment-gateways.php +++ b/tests/legacy/unit-tests/rest-api/Tests/Version2/payment-gateways.php @@ -49,21 +49,27 @@ class Payment_Gateways_V2 extends WC_REST_Unit_Test_Case { $this->assertEquals( 200, $response->get_status() ); $this->assertContains( array( - 'id' => 'cheque', - 'title' => 'Check payments', - 'description' => 'Please send a check to Store Name, Store Street, Store Town, Store State / County, Store Postcode.', - 'order' => '', - 'enabled' => false, - 'method_title' => 'Check payments', - 'method_description' => 'Take payments in person via checks. This offline gateway can also be useful to test purchases.', - 'settings' => array_diff_key( + 'id' => 'cheque', + 'title' => 'Check payments', + 'description' => 'Please send a check to Store Name, Store Street, Store Town, Store State / County, Store Postcode.', + 'order' => '', + 'enabled' => false, + 'method_title' => 'Check payments', + 'method_description' => 'Take payments in person via checks. This offline gateway can also be useful to test purchases.', + 'settings' => array_diff_key( $this->get_settings( 'WC_Gateway_Cheque' ), array( 'enabled' => false, 'description' => false, ) ), - '_links' => array( + 'needs_setup' => false, + 'post_install_scripts' => array(), + 'settings_url' => 'http://example.org/wp-admin/admin.php?page=wc-settings&tab=checkout§ion=cheque', + 'connection_url' => '', + 'setup_help_text' => '', + 'required_settings_keys' => array(), + '_links' => array( 'self' => array( array( 'href' => rest_url( '/wc/v2/payment_gateways/cheque' ), @@ -105,20 +111,26 @@ class Payment_Gateways_V2 extends WC_REST_Unit_Test_Case { $this->assertEquals( 200, $response->get_status() ); $this->assertEquals( array( - 'id' => 'paypal', - 'title' => 'PayPal', - 'description' => "Pay via PayPal; you can pay with your credit card if you don't have a PayPal account.", - 'order' => '', - 'enabled' => false, - 'method_title' => 'PayPal Standard', - 'method_description' => 'PayPal Standard redirects customers to PayPal to enter their payment information.', - 'settings' => array_diff_key( + 'id' => 'paypal', + 'title' => 'PayPal', + 'description' => "Pay via PayPal; you can pay with your credit card if you don't have a PayPal account.", + 'order' => '', + 'enabled' => false, + 'method_title' => 'PayPal Standard', + 'method_description' => 'PayPal Standard redirects customers to PayPal to enter their payment information.', + 'settings' => array_diff_key( $this->get_settings( 'WC_Gateway_Paypal' ), array( 'enabled' => false, 'description' => false, ) ), + 'needs_setup' => false, + 'post_install_scripts' => array(), + 'settings_url' => 'http://example.org/wp-admin/admin.php?page=wc-settings&tab=checkout§ion=paypal', + 'connection_url' => null, + 'setup_help_text' => null, + 'required_settings_keys' => array(), ), $paypal ); diff --git a/tests/legacy/unit-tests/rest-api/Tests/Version3/payment-gateways.php b/tests/legacy/unit-tests/rest-api/Tests/Version3/payment-gateways.php index 20f9245c8bd..8d272644a3d 100644 --- a/tests/legacy/unit-tests/rest-api/Tests/Version3/payment-gateways.php +++ b/tests/legacy/unit-tests/rest-api/Tests/Version3/payment-gateways.php @@ -49,24 +49,30 @@ class Payment_Gateways extends WC_REST_Unit_Test_Case { $this->assertEquals( 200, $response->get_status() ); $this->assertContains( array( - 'id' => 'cheque', - 'title' => 'Check payments', - 'description' => 'Please send a check to Store Name, Store Street, Store Town, Store State / County, Store Postcode.', - 'order' => '', - 'enabled' => false, - 'method_title' => 'Check payments', - 'method_description' => 'Take payments in person via checks. This offline gateway can also be useful to test purchases.', - 'method_supports' => array( + 'id' => 'cheque', + 'title' => 'Check payments', + 'description' => 'Please send a check to Store Name, Store Street, Store Town, Store State / County, Store Postcode.', + 'order' => '', + 'enabled' => false, + 'method_title' => 'Check payments', + 'method_description' => 'Take payments in person via checks. This offline gateway can also be useful to test purchases.', + 'method_supports' => array( 'products', ), - 'settings' => array_diff_key( + 'settings' => array_diff_key( $this->get_settings( 'WC_Gateway_Cheque' ), array( 'enabled' => false, 'description' => false, ) ), - '_links' => array( + 'needs_setup' => false, + 'post_install_scripts' => array(), + 'settings_url' => 'http://example.org/wp-admin/admin.php?page=wc-settings&tab=checkout§ion=cheque', + 'connection_url' => '', + 'setup_help_text' => '', + 'required_settings_keys' => array(), + '_links' => array( 'self' => array( array( 'href' => rest_url( '/wc/v3/payment_gateways/cheque' ), @@ -108,24 +114,30 @@ class Payment_Gateways extends WC_REST_Unit_Test_Case { $this->assertEquals( 200, $response->get_status() ); $this->assertEquals( array( - 'id' => 'paypal', - 'title' => 'PayPal', - 'description' => "Pay via PayPal; you can pay with your credit card if you don't have a PayPal account.", - 'order' => '', - 'enabled' => false, - 'method_title' => 'PayPal Standard', - 'method_description' => 'PayPal Standard redirects customers to PayPal to enter their payment information.', - 'method_supports' => array( + 'id' => 'paypal', + 'title' => 'PayPal', + 'description' => "Pay via PayPal; you can pay with your credit card if you don't have a PayPal account.", + 'order' => '', + 'enabled' => false, + 'method_title' => 'PayPal Standard', + 'method_description' => 'PayPal Standard redirects customers to PayPal to enter their payment information.', + 'method_supports' => array( 'products', 'refunds', ), - 'settings' => array_diff_key( + 'settings' => array_diff_key( $this->get_settings( 'WC_Gateway_Paypal' ), array( 'enabled' => false, 'description' => false, ) ), + 'needs_setup' => false, + 'post_install_scripts' => array(), + 'settings_url' => 'http://example.org/wp-admin/admin.php?page=wc-settings&tab=checkout§ion=paypal', + 'connection_url' => null, + 'setup_help_text' => null, + 'required_settings_keys' => array(), ), $paypal ); diff --git a/tests/php/includes/settings/class-wc-settings-advanced-test.php b/tests/php/includes/settings/class-wc-settings-advanced-test.php index fd1b05f1358..eeb9343cd2f 100644 --- a/tests/php/includes/settings/class-wc-settings-advanced-test.php +++ b/tests/php/includes/settings/class-wc-settings-advanced-test.php @@ -29,6 +29,7 @@ class WC_Settings_Advanced_Test extends WC_Settings_Unit_Test_Case { 'webhooks', 'legacy_api', 'woocommerce_com', + 'features', ); $this->assertEquals( $expected, $section_names );