Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.

Commit 56fcbb0

Browse files
committed
Including specific unit test
1 parent a6407e2 commit 56fcbb0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/unit/test-class-wc-subscriptions.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2069,6 +2069,13 @@ public function test_get_last_order() {
20692069
$last_order_object = $subscription->get_last_order( 'all' );
20702070
$this->assertInstanceOf( 'WC_Order', $last_order_object );
20712071
$this->assertEquals( $renewal_id, wcs_get_objects_property( $last_order_object, 'id' ) );
2072+
2073+
// Test for the status filtering parameter
2074+
$renewal = WCS_Helper_Subscription::create_renewal_order( $subscription );
2075+
$renewal->update_status( 'failed' );
2076+
$renewal_id = $renewal->get_id();
2077+
$this->assertEquals( $renewal_id, $subscription->get_last_order( 'ids' ) );
2078+
$this->assertFalse( $subscription->get_last_order( 'ids', array( 'parent', 'renewal' ), array( 'failed' ) ) );
20722079
}
20732080

20742081

0 commit comments

Comments
 (0)