Fix tests

This commit is contained in:
Mike Jolley 2017-05-25 18:16:10 +01:00
parent 7f0fcac090
commit ba305eacb5
2 changed files with 7 additions and 7 deletions

View File

@ -595,11 +595,11 @@ class WC_Product_CSV_Importer extends WC_Product_Importer {
if ( is_wp_error( $result ) ) {
$result->add_data( array( 'row' => $this->get_row_id( $parsed_data ) ) );
$data['failed'][] = $result;
$data['failed'][] = $result['id'];
} elseif ( $result['updated'] ) {
$data['updated'][] = $result;
$data['updated'][] = $result['id'];
} else {
$data['imported'][] = $result;
$data['imported'][] = $result['id'];
}
}

View File

@ -50,7 +50,7 @@ class WC_Tests_Product_CSV_Importer extends WC_Unit_Test_Case {
// Exclude imported products.
foreach ( $results['imported'] as $id ) {
wp_delete_post( $id );
wp_delete_post( $id, true );
}
}
@ -150,7 +150,7 @@ class WC_Tests_Product_CSV_Importer extends WC_Unit_Test_Case {
'type' => 'simple',
'sku' => 'PRODUCT-01',
'name' => 'Imported Product 1',
'published' => 1,
'published' => true,
'regular_price' => '40',
'meta_data' => array(),
'attributes' => array(),
@ -164,7 +164,7 @@ class WC_Tests_Product_CSV_Importer extends WC_Unit_Test_Case {
'type' => 'simple',
'sku' => 'PRODUCT-02',
'name' => 'Imported Product 2',
'published' => 1,
'published' => true,
'regular_price' => '41',
'meta_data' => array(),
'attributes' => array(),
@ -178,7 +178,7 @@ class WC_Tests_Product_CSV_Importer extends WC_Unit_Test_Case {
'type' => 'simple',
'sku' => 'PRODUCT-03',
'name' => 'Imported Product 3',
'published' => 1,
'published' => true,
'regular_price' => '42',
'meta_data' => array(),
'attributes' => array(),