This repository was archived by the owner on Jun 15, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,19 @@ public function test_search_orders_only_checks_post_meta_if_specified() {
128128 );
129129 }
130130
131+ public function test_search_orders_checks_table_for_product_item_matches () {
132+ $ product = $ this ->factory ()->product ->create_and_get ();
133+ $ order = $ this ->factory ()->order ->create_and_get ();
134+ $ order ->add_product ( $ product );
135+ $ order ->save ();
136+
137+ $ this ->assertEquals (
138+ array ( $ order ->get_id () ),
139+ ( new WC_Order_Data_Store_Custom_Table () )->search_orders ( $ product ->get_name () ),
140+ 'Order searches should extend to the names of product items. '
141+ );
142+ }
143+
131144 /**
132145 * @dataProvider order_type_provider()
133146 */
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ function __construct( $factory = null ) {
1919 'post_title ' => new WP_UnitTest_Generator_Sequence ( 'Product name %s ' ),
2020 'post_content ' => new WP_UnitTest_Generator_Sequence ( 'Product description %s ' ),
2121 'post_excerpt ' => new WP_UnitTest_Generator_Sequence ( 'Product short description %s ' ),
22- 'post_type ' => 'post ' ,
22+ 'post_type ' => 'product ' ,
2323 );
2424 }
2525
You can’t perform that action at this time.
0 commit comments