From ad0eff11de980762ec60da9dd493270303cdbc1b Mon Sep 17 00:00:00 2001 From: Mahmoud Saeed Date: Thu, 15 Oct 2020 07:34:20 +0200 Subject: [PATCH] Add unit test for WC_Tax::get_tax_rate_classes() --- tests/legacy/unit-tests/tax/tax.php | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/tests/legacy/unit-tests/tax/tax.php b/tests/legacy/unit-tests/tax/tax.php index ff53ba1c603..ce850eb32e4 100644 --- a/tests/legacy/unit-tests/tax/tax.php +++ b/tests/legacy/unit-tests/tax/tax.php @@ -466,8 +466,25 @@ class WC_Tests_Tax extends WC_Unit_Test_Case { $tax_classes = WC_Tax::get_tax_classes(); $this->assertEquals( $tax_classes, array( 'Reduced rate', 'Zero rate' ) ); - $tax_classes = WC_Tax::get_tax_class_slugs(); - $this->assertEquals( $tax_classes, array( 'reduced-rate', 'zero-rate' ) ); + $tax_class_slugs = WC_Tax::get_tax_class_slugs(); + $this->assertEquals( $tax_class_slugs, array( 'reduced-rate', 'zero-rate' ) ); + + $tax_rate_classes = WC_Tax::get_tax_rate_classes(); + $this->assertEquals( + $tax_rate_classes, + array( + (object) array( + 'tax_rate_class_id' => '1', + 'name' => 'Reduced rate', + 'slug' => 'reduced-rate', + ), + (object) array( + 'tax_rate_class_id' => '2', + 'name' => 'Zero rate', + 'slug' => 'zero-rate', + ), + ) + ); } /**