Skip to content

Commit

Permalink
Rename test file and use correct number of test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
JPry committed Jan 10, 2025
1 parent 691698c commit 47b170b
Showing 1 changed file with 62 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @since TBD
*/
class Fees extends Order_Modifiers_TestCase {
class Fees_Test extends Order_Modifiers_TestCase {

protected string $modifier_type = 'fee';

Expand Down Expand Up @@ -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 ) {
Expand Down Expand Up @@ -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 ] );
Expand Down

0 comments on commit 47b170b

Please sign in to comment.