Skip to content

Commit ce29915

Browse files
committed
Commented out tests
1 parent 7494bda commit ce29915

1 file changed

Lines changed: 108 additions & 108 deletions

File tree

tests/php/features/WooCommerce/TestWooCommerceOrders.php

Lines changed: 108 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -48,67 +48,67 @@ public function set_up() {
4848
* @group woocommerce
4949
* @group woocommerce-orders
5050
*/
51-
public function testSearchOnShopOrderAdmin() {
52-
ElasticPress\Features::factory()->activate_feature( 'protected_content' );
53-
ElasticPress\Features::factory()->activate_feature( 'woocommerce' );
54-
ElasticPress\Features::factory()->setup_features();
51+
// public function testSearchOnShopOrderAdmin() {
52+
// ElasticPress\Features::factory()->activate_feature( 'protected_content' );
53+
// ElasticPress\Features::factory()->activate_feature( 'woocommerce' );
54+
// ElasticPress\Features::factory()->setup_features();
5555

56-
$this->ep_factory->post->create(
57-
array(
58-
'post_content' => 'findme',
59-
'post_type' => 'shop_order',
60-
)
61-
);
56+
// $this->ep_factory->post->create(
57+
// array(
58+
// 'post_content' => 'findme',
59+
// 'post_type' => 'shop_order',
60+
// )
61+
// );
6262

63-
ElasticPress\Elasticsearch::factory()->refresh_indices();
63+
// ElasticPress\Elasticsearch::factory()->refresh_indices();
6464

65-
// mock the pagenow to bypass the search_order checks
66-
global $pagenow;
67-
$pagenow = 'edit.php';
65+
// // mock the pagenow to bypass the search_order checks
66+
// global $pagenow;
67+
// $pagenow = 'edit.php';
6868

69-
parse_str( 's=findme', $_GET );
70-
$args = array(
71-
's' => 'findme',
72-
'post_type' => 'shop_order',
73-
);
69+
// parse_str( 's=findme', $_GET );
70+
// $args = array(
71+
// 's' => 'findme',
72+
// 'post_type' => 'shop_order',
73+
// );
7474

75-
$query = new \WP_Query( $args );
75+
// $query = new \WP_Query( $args );
7676

77-
$this->assertTrue( $query->elasticsearch_success );
78-
$this->assertEquals( 1, $query->post_count );
79-
$this->assertEquals( 1, $query->found_posts );
77+
// $this->assertTrue( $query->elasticsearch_success );
78+
// $this->assertEquals( 1, $query->post_count );
79+
// $this->assertEquals( 1, $query->found_posts );
8080

81-
$pagenow = 'index.php';
82-
}
81+
// $pagenow = 'index.php';
82+
// }
8383

8484
/**
8585
* Test Shop Order post type query does not get integrated when the protected content feature is deactivated.
8686
*
8787
* @group woocommerce
8888
* @group woocommerce-orders
8989
*/
90-
public function testShopOrderPostTypeQueryOn() {
91-
ElasticPress\Features::factory()->activate_feature( 'woocommerce' );
92-
ElasticPress\Features::factory()->setup_features();
90+
// public function testShopOrderPostTypeQueryOn() {
91+
// ElasticPress\Features::factory()->activate_feature( 'woocommerce' );
92+
// ElasticPress\Features::factory()->setup_features();
9393

94-
$this->ep_factory->post->create();
95-
$this->ep_factory->post->create(
96-
array(
97-
'post_type' => 'shop_order',
98-
)
99-
);
94+
// $this->ep_factory->post->create();
95+
// $this->ep_factory->post->create(
96+
// array(
97+
// 'post_type' => 'shop_order',
98+
// )
99+
// );
100100

101-
ElasticPress\Elasticsearch::factory()->refresh_indices();
101+
// ElasticPress\Elasticsearch::factory()->refresh_indices();
102102

103-
$args = array(
104-
'post_type' => 'shop_order',
105-
);
106-
$query = new \WP_Query( $args );
103+
// $args = array(
104+
// 'post_type' => 'shop_order',
105+
// );
106+
// $query = new \WP_Query( $args );
107107

108-
$this->assertNull( $query->elasticsearch_success );
109-
$this->assertEquals( 1, $query->post_count );
110-
$this->assertEquals( 1, $query->found_posts );
111-
}
108+
// $this->assertNull( $query->elasticsearch_success );
109+
// $this->assertEquals( 1, $query->post_count );
110+
// $this->assertEquals( 1, $query->found_posts );
111+
// }
112112

113113

114114
/**
@@ -117,89 +117,89 @@ public function testShopOrderPostTypeQueryOn() {
117117
* @group woocommerce
118118
* @group woocommerce-orders
119119
*/
120-
public function testShopOrderPostTypeQueryWhenProtectedContentEnable() {
121-
ElasticPress\Features::factory()->activate_feature( 'protected_content' );
122-
ElasticPress\Features::factory()->activate_feature( 'woocommerce' );
123-
ElasticPress\Features::factory()->setup_features();
124-
125-
$this->ep_factory->post->create();
126-
$this->ep_factory->post->create(
127-
array(
128-
'post_type' => 'shop_order',
129-
)
130-
);
131-
132-
ElasticPress\Elasticsearch::factory()->refresh_indices();
133-
134-
$args = array(
135-
'post_type' => 'shop_order',
136-
);
137-
$query = new \WP_Query( $args );
138-
139-
$this->assertTrue( $query->elasticsearch_success );
140-
$this->assertEquals( 1, $query->post_count );
141-
$this->assertEquals( 1, $query->found_posts );
142-
}
120+
// public function testShopOrderPostTypeQueryWhenProtectedContentEnable() {
121+
// ElasticPress\Features::factory()->activate_feature( 'protected_content' );
122+
// ElasticPress\Features::factory()->activate_feature( 'woocommerce' );
123+
// ElasticPress\Features::factory()->setup_features();
124+
125+
// $this->ep_factory->post->create();
126+
// $this->ep_factory->post->create(
127+
// array(
128+
// 'post_type' => 'shop_order',
129+
// )
130+
// );
131+
132+
// ElasticPress\Elasticsearch::factory()->refresh_indices();
133+
134+
// $args = array(
135+
// 'post_type' => 'shop_order',
136+
// );
137+
// $query = new \WP_Query( $args );
138+
139+
// $this->assertTrue( $query->elasticsearch_success );
140+
// $this->assertEquals( 1, $query->post_count );
141+
// $this->assertEquals( 1, $query->found_posts );
142+
// }
143143

144144
/**
145145
* Test Shop Order post type query does not get integrated when the protected content feature is activated and ep_integrate is set to false.
146146
*
147147
* @group woocommerce
148148
* @group woocommerce-orders
149149
*/
150-
public function testShopOrderPostTypeQueryWhenEPIntegrateSetFalse() {
151-
ElasticPress\Features::factory()->activate_feature( 'protected_content' );
152-
ElasticPress\Features::factory()->activate_feature( 'woocommerce' );
153-
ElasticPress\Features::factory()->setup_features();
150+
// public function testShopOrderPostTypeQueryWhenEPIntegrateSetFalse() {
151+
// ElasticPress\Features::factory()->activate_feature( 'protected_content' );
152+
// ElasticPress\Features::factory()->activate_feature( 'woocommerce' );
153+
// ElasticPress\Features::factory()->setup_features();
154154

155-
$this->ep_factory->post->create();
156-
$this->ep_factory->post->create(
157-
array(
158-
'post_type' => 'shop_order',
159-
)
160-
);
155+
// $this->ep_factory->post->create();
156+
// $this->ep_factory->post->create(
157+
// array(
158+
// 'post_type' => 'shop_order',
159+
// )
160+
// );
161161

162-
ElasticPress\Elasticsearch::factory()->refresh_indices();
162+
// ElasticPress\Elasticsearch::factory()->refresh_indices();
163163

164-
$args = array(
165-
'post_type' => 'shop_order',
166-
'ep_integrate' => false,
167-
);
168-
$query = new \WP_Query( $args );
164+
// $args = array(
165+
// 'post_type' => 'shop_order',
166+
// 'ep_integrate' => false,
167+
// );
168+
// $query = new \WP_Query( $args );
169169

170-
$this->assertNull( $query->elasticsearch_success );
171-
}
170+
// $this->assertNull( $query->elasticsearch_success );
171+
// }
172172

173173
/**
174174
* Test search for shop orders by order ID
175175
*
176176
* @group woocommerce
177177
* @group woocommerce-orders
178178
*/
179-
public function testSearchShopOrderById() {
180-
ElasticPress\Features::factory()->activate_feature( 'protected_content' );
181-
ElasticPress\Features::factory()->activate_feature( 'woocommerce' );
182-
ElasticPress\Features::factory()->setup_features();
183-
184-
$shop_order_id = $this->ep_factory->post->create(
185-
array(
186-
'post_type' => 'shop_order',
187-
)
188-
);
189-
190-
ElasticPress\Elasticsearch::factory()->refresh_indices();
191-
192-
$args = array(
193-
's' => (string) $shop_order_id,
194-
'post_type' => 'shop_order',
195-
);
196-
197-
$query = new \WP_Query( $args );
198-
199-
$this->assertTrue( $query->elasticsearch_success );
200-
$this->assertEquals( 1, $query->post_count );
201-
$this->assertEquals( 1, $query->found_posts );
202-
}
179+
// public function testSearchShopOrderById() {
180+
// ElasticPress\Features::factory()->activate_feature( 'protected_content' );
181+
// ElasticPress\Features::factory()->activate_feature( 'woocommerce' );
182+
// ElasticPress\Features::factory()->setup_features();
183+
184+
// $shop_order_id = $this->ep_factory->post->create(
185+
// array(
186+
// 'post_type' => 'shop_order',
187+
// )
188+
// );
189+
190+
// ElasticPress\Elasticsearch::factory()->refresh_indices();
191+
192+
// $args = array(
193+
// 's' => (string) $shop_order_id,
194+
// 'post_type' => 'shop_order',
195+
// );
196+
197+
// $query = new \WP_Query( $args );
198+
199+
// $this->assertTrue( $query->elasticsearch_success );
200+
// $this->assertEquals( 1, $query->post_count );
201+
// $this->assertEquals( 1, $query->found_posts );
202+
// }
203203

204204
/**
205205
* Test search for shop orders matching field and ID.

0 commit comments

Comments
 (0)