phpcs fixes

This commit is contained in:
Ron Rennick 2020-08-25 15:41:31 -03:00
parent de79f1a3cd
commit 81dae70033
2 changed files with 13 additions and 15 deletions

View File

@ -5,7 +5,6 @@
* @package WooCommerce\Tests\API
* @since 3.0.0
*/
class Payment_Gateways_V2 extends WC_REST_Unit_Test_Case {
/**
@ -151,7 +150,7 @@ class Payment_Gateways_V2 extends WC_REST_Unit_Test_Case {
public function test_update_payment_gateway() {
wp_set_current_user( $this->user );
// Test defaults
// Test defaults.
$response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v2/payment_gateways/paypal' ) );
$paypal = $response->get_data();
@ -159,7 +158,7 @@ class Payment_Gateways_V2 extends WC_REST_Unit_Test_Case {
$this->assertEquals( 'admin@example.org', $paypal['settings']['email']['value'] );
$this->assertEquals( 'no', $paypal['settings']['testmode']['value'] );
// test updating single setting
// Test updating single setting.
$request = new WP_REST_Request( 'POST', '/wc/v2/payment_gateways/paypal' );
$request->set_body_params(
array(
@ -176,7 +175,7 @@ class Payment_Gateways_V2 extends WC_REST_Unit_Test_Case {
$this->assertEquals( 'woo@woo.local', $paypal['settings']['email']['value'] );
$this->assertEquals( 'no', $paypal['settings']['testmode']['value'] );
// test updating multiple settings
// Test updating multiple settings.
$request = new WP_REST_Request( 'POST', '/wc/v2/payment_gateways/paypal' );
$request->set_body_params(
array(
@ -194,7 +193,7 @@ class Payment_Gateways_V2 extends WC_REST_Unit_Test_Case {
$this->assertEquals( 'woo@woo.local', $paypal['settings']['email']['value'] );
$this->assertEquals( 'yes', $paypal['settings']['testmode']['value'] );
// Test other parameters, and recheck settings
// Test other parameters, and recheck settings.
$request = new WP_REST_Request( 'POST', '/wc/v2/payment_gateways/paypal' );
$request->set_body_params(
array(
@ -211,7 +210,7 @@ class Payment_Gateways_V2 extends WC_REST_Unit_Test_Case {
$this->assertEquals( 'woo@woo.local', $paypal['settings']['email']['value'] );
$this->assertEquals( 'yes', $paypal['settings']['testmode']['value'] );
// test bogus
// Test bogus parameter.
$request = new WP_REST_Request( 'POST', '/wc/v2/payment_gateways/paypal' );
$request->set_body_params(
array(
@ -308,11 +307,11 @@ class Payment_Gateways_V2 extends WC_REST_Unit_Test_Case {
$settings = array();
$gateway->init_form_fields();
foreach ( $gateway->form_fields as $id => $field ) {
// Make sure we at least have a title and type
// Make sure we at least have a title and type.
if ( empty( $field['title'] ) || empty( $field['type'] ) ) {
continue;
}
// Ignore 'title' settings/fields -- they are UI only
// Ignore 'title' settings/fields -- they are UI only.
if ( 'title' === $field['type'] ) {
continue;
}

View File

@ -5,7 +5,6 @@
* @package WooCommerce\Tests\API
* @since 3.5.0
*/
class Payment_Gateways extends WC_REST_Unit_Test_Case {
/**
@ -158,7 +157,7 @@ class Payment_Gateways extends WC_REST_Unit_Test_Case {
public function test_update_payment_gateway() {
wp_set_current_user( $this->user );
// Test defaults
// Test defaults.
$response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v3/payment_gateways/paypal' ) );
$paypal = $response->get_data();
@ -166,7 +165,7 @@ class Payment_Gateways extends WC_REST_Unit_Test_Case {
$this->assertEquals( 'admin@example.org', $paypal['settings']['email']['value'] );
$this->assertEquals( 'no', $paypal['settings']['testmode']['value'] );
// test updating single setting
// Test updating single setting.
$request = new WP_REST_Request( 'POST', '/wc/v3/payment_gateways/paypal' );
$request->set_body_params(
array(
@ -183,7 +182,7 @@ class Payment_Gateways extends WC_REST_Unit_Test_Case {
$this->assertEquals( 'woo@woo.local', $paypal['settings']['email']['value'] );
$this->assertEquals( 'no', $paypal['settings']['testmode']['value'] );
// test updating multiple settings
// Test updating multiple settings.
$request = new WP_REST_Request( 'POST', '/wc/v3/payment_gateways/paypal' );
$request->set_body_params(
array(
@ -201,7 +200,7 @@ class Payment_Gateways extends WC_REST_Unit_Test_Case {
$this->assertEquals( 'woo@woo.local', $paypal['settings']['email']['value'] );
$this->assertEquals( 'yes', $paypal['settings']['testmode']['value'] );
// Test other parameters, and recheck settings
// Test other parameters, and recheck settings.
$request = new WP_REST_Request( 'POST', '/wc/v3/payment_gateways/paypal' );
$request->set_body_params(
array(
@ -218,7 +217,7 @@ class Payment_Gateways extends WC_REST_Unit_Test_Case {
$this->assertEquals( 'woo@woo.local', $paypal['settings']['email']['value'] );
$this->assertEquals( 'yes', $paypal['settings']['testmode']['value'] );
// test bogus
// Test bogus paramter.
$request = new WP_REST_Request( 'POST', '/wc/v3/payment_gateways/paypal' );
$request->set_body_params(
array(
@ -316,7 +315,7 @@ class Payment_Gateways extends WC_REST_Unit_Test_Case {
$settings = array();
$gateway->init_form_fields();
foreach ( $gateway->form_fields as $id => $field ) {
// Make sure we at least have a title and type
// Make sure we at least have a title and type.
if ( empty( $field['title'] ) || empty( $field['type'] ) ) {
continue;
}