From 07c18b59f0efacc4b90881bd8f0f34435f11e756 Mon Sep 17 00:00:00 2001 From: Gerhard Potgieter Date: Thu, 24 May 2018 11:28:24 +0200 Subject: [PATCH] Add unit test to test again passing a coupon object in the constructor --- tests/unit-tests/coupon/coupon.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/unit-tests/coupon/coupon.php b/tests/unit-tests/coupon/coupon.php index f1e409f4848..cc879fd97d3 100644 --- a/tests/unit-tests/coupon/coupon.php +++ b/tests/unit-tests/coupon/coupon.php @@ -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. $test_coupon = new WC_Coupon( (string) $coupon_2->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() ); } /**