update customer unit test
This commit is contained in:
parent
d1d2c89ca9
commit
bd65e65285
|
@ -44,16 +44,17 @@ class Customers extends WC_REST_Unit_Test_Case {
|
||||||
$request->set_query_params( array(
|
$request->set_query_params( array(
|
||||||
'orderby' => 'id',
|
'orderby' => 'id',
|
||||||
) );
|
) );
|
||||||
$response = $this->server->dispatch( $request );
|
$response = $this->server->dispatch( $request );
|
||||||
$customers = $response->get_data();
|
$customers = $response->get_data();
|
||||||
|
$date_created = get_date_from_gmt( $customer_1->get_date_created() );
|
||||||
|
|
||||||
$this->assertEquals( 200, $response->get_status() );
|
$this->assertEquals( 200, $response->get_status() );
|
||||||
$this->assertEquals( 2, count( $customers ) );
|
$this->assertEquals( 2, count( $customers ) );
|
||||||
|
|
||||||
$this->assertContains( array(
|
$this->assertContains( array(
|
||||||
'id' => $customer_1->get_id(),
|
'id' => $customer_1->get_id(),
|
||||||
'date_created' => wc_rest_prepare_date_response( $customer_1->get_date_created(), false ),
|
'date_created' => wc_rest_prepare_date_response( $date_created, false ),
|
||||||
'date_created_gmt' => wc_rest_prepare_date_response( $customer_1->get_date_created() ),
|
'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' => wc_rest_prepare_date_response( $customer_1->get_date_modified(), false ),
|
||||||
'date_modified_gmt' => wc_rest_prepare_date_response( $customer_1->get_date_modified() ),
|
'date_modified_gmt' => wc_rest_prepare_date_response( $customer_1->get_date_modified() ),
|
||||||
'email' => 'test@woo.local',
|
'email' => 'test@woo.local',
|
||||||
|
|
Loading…
Reference in New Issue