Skip to content

Commit

Permalink
Refactor tax calculation in WithTaxTest
Browse files Browse the repository at this point in the history
  • Loading branch information
Blair2004 committed Apr 18, 2024
1 parent 6700944 commit 3c5e8d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/Traits/WithTaxTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ private function assertCheck( $details, ?callable $callback = null )
$expectedTax = $taxService->getComputedTaxGroupValue( $order[ 'tax_type' ], $order[ 'tax_group_id' ], ns()->currency->define( $order[ 'subtotal' ] )->subtractBy( $order[ 'discount' ] )->getRaw() );

if ( $callback === null ) {
$this->assertEquals( (float) $expectedTax, (float) $order[ 'tax_value' ], __( 'The computed taxes aren\'t correct.' ) );
$this->assertEquals( (float) $expectedTax, (float) ns()->currency->define( $order[ 'tax_value' ] )->toFloat(), __( 'The computed taxes aren\'t correct.' ) );
} else {
$callback( $order );
}
Expand Down

0 comments on commit 3c5e8d2

Please sign in to comment.