Skip to content

Commit

Permalink
fix failing test from master
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Sep 9, 2016
1 parent 831b446 commit 230c039
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion includes/api/class-wc-rest-settings-options-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ public function cast_image_width( $setting ) {
if ( isset( $setting[ $key ] ) ) {
$setting[ $key ]['width'] = intval( $setting[ $key ]['width'] );
$setting[ $key ]['height'] = intval( $setting[ $key ]['height'] );
$setting[ $key ]['crop'] = (bool) $setting[ $key ]['crop'];
$setting[ $key ]['crop'] = (bool) $setting[ $key ]['crop'];
}
}
return $setting;
Expand Down
8 changes: 4 additions & 4 deletions includes/class-wc-register-wp-admin-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct( $object, $type ) {
if ( 'page' === $type ) {
add_filter( 'woocommerce_settings_groups', array( $this, 'register_page_group' ) );
add_filter( 'woocommerce_settings-' . $this->object->get_id(), array( $this, 'register_page_settings' ) );
} else if ( 'email' === $type ) {
} elseif ( 'email' === $type ) {
add_filter( 'woocommerce_settings_groups', array( $this, 'register_email_group' ) );
add_filter( 'woocommerce_settings-email_' . $this->object->id, array( $this, 'register_email_settings' ) );
}
Expand Down Expand Up @@ -135,9 +135,9 @@ public function register_setting( $setting ) {
}

$description = '';
if ( ! empty ( $setting['desc'] ) ) {
if ( ! empty( $setting['desc'] ) ) {
$description = $setting['desc'];
} else if ( ! empty( $setting['description'] ) ) {
} elseif ( ! empty( $setting['description'] ) ) {
$description = $setting['description'];
}

Expand All @@ -158,7 +158,7 @@ public function register_setting( $setting ) {
if ( isset( $setting['desc_tip'] ) ) {
if ( true === $setting['desc_tip'] ) {
$new_setting['tip'] = $description;
} else if ( ! empty( $setting['desc_tip'] ) ) {
} elseif ( ! empty( $setting['desc_tip'] ) ) {
$new_setting['tip'] = $setting['desc_tip'];
}
}
Expand Down
1 change: 1 addition & 0 deletions phpcs.ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
<exclude name="WordPress.Functions.DontExtract.extract" />
<exclude name="WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid" />
<exclude name="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid" />
<exclude name="WordPress.NamingConventions.ValidHookName.UseUnderscores" />
<exclude name="WordPress.NamingConventions.ValidVariableName.MemberNotSnakeCase" />
<exclude name="WordPress.NamingConventions.ValidVariableName.NotSnakeCase" />
<exclude name="WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar" />
Expand Down
4 changes: 2 additions & 2 deletions tests/unit-tests/api/payment-gateways.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public function test_update_payment_gateway() {
$request->set_body_params( array(
'settings' => array(
'paymentaction' => 'afasfasf',
)
),
) );
$response = $this->server->dispatch( $request );
$this->assertEquals( 400, $response->get_status() );
Expand All @@ -199,7 +199,7 @@ public function test_update_payment_gateway() {
$request->set_body_params( array(
'settings' => array(
'paymentaction' => 'authorization',
)
),
) );
$response = $this->server->dispatch( $request );
$paypal = $response->get_data();
Expand Down

0 comments on commit 230c039

Please sign in to comment.