Skip to content

Commit

Permalink
Linting fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
vedanshujain committed Jan 15, 2024
1 parent c3b58e3 commit bd2c611
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Expand Up @@ -987,7 +987,7 @@ public function get_orders( $args = array() ) {
/**
* Get unpaid orders last updated before the specified date.
*
* @param int $date This timestamp is expected in the timezone in WordPress settings legacy reason, even though it's not a good practice.
* @param int $date This timestamp is expected in the timezone in WordPress settings for legacy reason, even though it's not a good practice.
*
* @return array Array of order IDs.
*/
Expand Down
Expand Up @@ -1207,7 +1207,8 @@ public function test_get_order_count(): void {
*/
public function test_get_unpaid_orders(): void {
// phpcs:ignore WordPress.DateTime.CurrentTimeTimestamp.Requested -- Intentional usage since timezone is changed for this file.
$now_gmt = current_time( 'timestamp', 1 );
$now_gmt = time();
// phpcs:ignore WordPress.DateTime.CurrentTimeTimestamp.Requested -- Testing a legacy code that does expect the offset timestamp.
$now_ist = current_time( 'timestamp', 0 ); // IST (Indian standard time) is 5.5 hours ahead of GMT and is set as timezone for this class.

// Create a few orders.
Expand Down Expand Up @@ -3028,7 +3029,6 @@ public function test_timezone_date_query_support() {
$order->set_date_created( '2023-09-01T00:30:00' ); // This would be 2023-08-31T18:00:00 UTC given the current timezone.
$this->sut->create( $order );


$query = new OrdersTableQuery( array( 'date_created_gmt' => '2023-09-01' ) );
$this->assertEquals( 0, count( $query->orders ) ); // Should not return anything as the order was created on 2023-08-31 UTC.

Expand Down Expand Up @@ -3058,9 +3058,12 @@ public function test_data_retained_when_hooked_in_cache_filter() {
$this->toggle_cot_authoritative( true );
$this->enable_cot_sync();

add_action( 'woocommerce_delete_shop_order_transients', function ( $order_id ) {
wc_get_order( $order_id );
} );
add_action(
'woocommerce_delete_shop_order_transients',
function ( $order_id ) {
wc_get_order( $order_id );
}
);
$order = OrderHelper::create_order();

$this->assertEquals( 1, $order->get_customer_id() );
Expand All @@ -3087,7 +3090,7 @@ public function test_order_cache_is_cleared_on_meta_save() {

$order = OrderHelper::create_order();

// set the cache
// set the cache.
wc_get_order( $order->get_id() );

$order->add_meta_data( 'test_key', 'test_value' );
Expand Down

0 comments on commit bd2c611

Please sign in to comment.