Add tests to check for duplicated meta records.
This commit is contained in:
parent
f063d40c95
commit
f7bd637845
|
@ -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'
|
||||
"
|
||||
)
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue