diff --git a/tests/unit-tests/api/customers.php b/tests/unit-tests/api/customers.php index 54f96cae51d..5a9898fbfd0 100644 --- a/tests/unit-tests/api/customers.php +++ b/tests/unit-tests/api/customers.php @@ -44,16 +44,17 @@ class Customers extends WC_REST_Unit_Test_Case { $request->set_query_params( array( 'orderby' => 'id', ) ); - $response = $this->server->dispatch( $request ); - $customers = $response->get_data(); + $response = $this->server->dispatch( $request ); + $customers = $response->get_data(); + $date_created = get_date_from_gmt( $customer_1->get_date_created() ); $this->assertEquals( 200, $response->get_status() ); $this->assertEquals( 2, count( $customers ) ); $this->assertContains( array( 'id' => $customer_1->get_id(), - 'date_created' => wc_rest_prepare_date_response( $customer_1->get_date_created(), false ), - 'date_created_gmt' => wc_rest_prepare_date_response( $customer_1->get_date_created() ), + 'date_created' => wc_rest_prepare_date_response( $date_created, false ), + 'date_created_gmt' => wc_rest_prepare_date_response( $date_created ), 'date_modified' => wc_rest_prepare_date_response( $customer_1->get_date_modified(), false ), 'date_modified_gmt' => wc_rest_prepare_date_response( $customer_1->get_date_modified() ), 'email' => 'test@woo.local',