Add unit test to test again passing a coupon object in the constructor

This commit is contained in:
Gerhard Potgieter 2018-05-24 11:28:24 +02:00
parent 288b5d9117
commit 07c18b59f0
1 changed files with 4 additions and 0 deletions

View File

@ -44,6 +44,10 @@ class WC_Tests_Coupon extends WC_Unit_Test_Case {
// Required for backwards compatibility, but will try and initialize coupon by code if possible first. // Required for backwards compatibility, but will try and initialize coupon by code if possible first.
$test_coupon = new WC_Coupon( (string) $coupon_2->get_id() ); $test_coupon = new WC_Coupon( (string) $coupon_2->get_id() );
$this->assertEquals( $coupon_2->get_id(), $test_coupon->get_id() ); $this->assertEquals( $coupon_2->get_id(), $test_coupon->get_id() );
// Test getting a coupon by coupon object
$test_coupon = new WC_Coupon( $coupon_1 );
$this->assertEquals( $test_coupon->get_id(), $coupon_1->get_id() );
} }
/** /**