Add tests to check for duplicated meta records.

This commit is contained in:
vedanshujain 2022-04-12 15:32:30 +05:30
parent f063d40c95
commit f7bd637845
1 changed files with 19 additions and 0 deletions

View File

@ -104,6 +104,25 @@ WHERE order_id = {$order_id} AND address_type = 'shipping'
"
SELECT COUNT(*) FROM {$this->data_store::get_operational_data_table_name()}
WHERE order_id = {$order_id}
"
)
);
$this->assertEquals(
1,
$wpdb->get_var(
"
SELECT COUNT(*) FROM {$this->data_store::get_meta_table_name()}
WHERE order_id = {$order_id} AND meta_key = 'unique_key_1'
"
)
);
$this->assertEquals(
2,
$wpdb->get_var(
"
SELECT COUNT(*) FROM {$this->data_store::get_meta_table_name()}
WHERE order_id = {$order_id} AND meta_key = 'non_unique_key_1'
"
)
);