Skip to content
This repository was archived by the owner on Jun 15, 2022. It is now read-only.

Commit d272e29

Browse files
committed
Two more instances of code that's too cool for PHP 5.3
1 parent be25b32 commit d272e29

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/test-data-store.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,14 @@ public function test_get_order_count() {
5353
}
5454

5555
public function test_get_order_count_filters_by_status() {
56+
$instance = new WC_Order_Data_Store_Custom_Table();
5657
$this->factory()->order->create( array(
5758
'post_status' => 'not_a_pending_status',
5859
) );
5960

6061
$this->assertEquals(
6162
0,
62-
( new WC_Order_Data_Store_Custom_Table() )->get_order_count( 'wc-pending' ),
63+
$instance->get_order_count( 'wc-pending' ),
6364
'The get_order_count() method should only count records matching $status.'
6465
);
6566
}
@@ -90,9 +91,11 @@ public function test_get_unpaid_orders_uses_date_filtering() {
9091
}
9192

9293
public function test_search_orders_can_search_by_order_id() {
94+
$instance = new WC_Order_Data_Store_Custom_Table();
95+
9396
$this->assertEquals(
9497
array( 123 ),
95-
( new WC_Order_Data_Store_Custom_Table() )->search_orders( 123 ),
98+
$instance->search_orders( 123 ),
9699
'When given a numeric value, search_orders() should include that order ID.'
97100
);
98101
}

0 commit comments

Comments
 (0)