From ab9630b43aa858fdb3b72612b9378e5d31a417fb Mon Sep 17 00:00:00 2001 From: Vedanshu Jain Date: Thu, 1 Jun 2023 18:07:33 +0530 Subject: [PATCH] Coding standard fixes. --- .../PostsToOrdersMigrationControllerTest.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/woocommerce/tests/php/src/Database/Migrations/CustomOrderTable/PostsToOrdersMigrationControllerTest.php b/plugins/woocommerce/tests/php/src/Database/Migrations/CustomOrderTable/PostsToOrdersMigrationControllerTest.php index c147eeb5c27..068864dec98 100644 --- a/plugins/woocommerce/tests/php/src/Database/Migrations/CustomOrderTable/PostsToOrdersMigrationControllerTest.php +++ b/plugins/woocommerce/tests/php/src/Database/Migrations/CustomOrderTable/PostsToOrdersMigrationControllerTest.php @@ -837,15 +837,16 @@ WHERE order_id = {$order_id} AND meta_key = 'non_unique_key_1' AND meta_value in $this->sut->migrate_order( $order->get_id() ); $errors = $this->sut->verify_migrated_orders( array( $order->get_id() ) ); + // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_print_r -- Intentional for informative debug message. $this->assertEmpty( $errors, 'Errors found in migrated data: ' . print_r( $errors, true ) ); - $order_tax = $wpdb->get_var( "SELECT tax_amount FROM {$wpdb->prefix}wc_orders WHERE id = {$order->get_id()}" ); + $order_tax = $wpdb->get_var( $wpdb->prepare( "SELECT tax_amount FROM {$wpdb->prefix}wc_orders WHERE id = %d", $order->get_id() ) ); $this->assertEquals( 0, $order_tax ); - $order_total = $wpdb->get_var( "SELECT total_amount FROM {$wpdb->prefix}wc_orders WHERE id = {$order->get_id()}" ); + $order_total = $wpdb->get_var( $wpdb->prepare( "SELECT total_amount FROM {$wpdb->prefix}wc_orders WHERE id = %d", $order->get_id() ) ); $this->assertEquals( 0.12, $order_total ); - $cart_discount_tax = $wpdb->get_var( "SELECT discount_tax_amount FROM {$wpdb->prefix}wc_order_operational_data WHERE order_id = {$order->get_id()}" ); + $cart_discount_tax = $wpdb->get_var( $wpdb->prepare( "SELECT discount_tax_amount FROM {$wpdb->prefix}wc_order_operational_data WHERE order_id = %d", $order->get_id() ) ); $this->assertEquals( 12.37, $cart_discount_tax ); } }