From 47b170b4192e3c2f8812c79c10bf1908382ccfc2 Mon Sep 17 00:00:00 2001 From: Jeremy Pry Date: Fri, 10 Jan 2025 12:22:44 -0600 Subject: [PATCH] Rename test file and use correct number of test cases --- .../Repositories/{Fees.php => Fees_Test.php} | 64 ++++++++++++++++++- 1 file changed, 62 insertions(+), 2 deletions(-) rename tests/order_modifiers_integration/Repositories/{Fees.php => Fees_Test.php} (61%) diff --git a/tests/order_modifiers_integration/Repositories/Fees.php b/tests/order_modifiers_integration/Repositories/Fees_Test.php similarity index 61% rename from tests/order_modifiers_integration/Repositories/Fees.php rename to tests/order_modifiers_integration/Repositories/Fees_Test.php index d6352d32e1..5917caa5f2 100644 --- a/tests/order_modifiers_integration/Repositories/Fees.php +++ b/tests/order_modifiers_integration/Repositories/Fees_Test.php @@ -10,7 +10,7 @@ * * @since TBD */ -class Fees extends Order_Modifiers_TestCase { +class Fees_Test extends Order_Modifiers_TestCase { protected string $modifier_type = 'fee'; @@ -41,6 +41,66 @@ protected function create_modifiers() { 'amount' => '20', 'sub_type' => 'flat', ], + [ + 'amount' => '15', + 'sub_type' => 'percentage', + ], + [ + 'amount' => '25', + 'sub_type' => 'percentage', + ], + [ + 'amount' => '30', + 'sub_type' => 'flat', + ], + [ + 'amount' => '50', + 'sub_type' => 'percentage', + ], + [ + 'amount' => '75', + 'sub_type' => 'percentage', + ], + [ + 'amount' => '100', + 'sub_type' => 'flat', + ], + [ + 'amount' => '200', + 'sub_type' => 'percentage', + ], + [ + 'amount' => '500', + 'sub_type' => 'percentage', + ], + [ + 'amount' => '750', + 'sub_type' => 'flat', + ], + [ + 'amount' => '1000', + 'sub_type' => 'percentage', + ], + [ + 'amount' => '1500', + 'sub_type' => 'percentage', + ], + [ + 'amount' => '2000', + 'sub_type' => 'flat', + ], + [ + 'amount' => '2500', + 'sub_type' => 'percentage', + ], + [ + 'amount' => '3000', + 'sub_type' => 'percentage', + ], + [ + 'amount' => '5000', + 'sub_type' => 'flat', + ] ]; foreach ( $samples as $index => $sample ) { @@ -71,7 +131,7 @@ public function should_find_all_fees() { // Test that we get the correct count of all fees. $count = $repo->get_search_count(); - $this->assertEquals( 20, $count ); + $this->assertEquals( 40, $count ); // Test that we get the correct number of fees with a limit. $results = $repo->search_modifiers( [ 'limit' => 5 ] );