Skip to content

Commit

Permalink
Add helpful failure messages in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Feb 28, 2025
1 parent 866551d commit 88500fc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/AbstractTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ final protected static function assertBigRationalEquals(string $expected, BigRat
*/
final protected static function assertBigDecimalInternalValues(string $unscaledValue, int $scale, BigDecimal $actual) : void
{
self::assertSame($unscaledValue, (string) $actual->getUnscaledValue());
self::assertSame($scale, $actual->getScale());
self::assertSame($unscaledValue, (string) $actual->getUnscaledValue(), 'Unscaled value mismatch');
self::assertSame($scale, $actual->getScale(), 'Scale mismatch');
}

/**
Expand All @@ -70,8 +70,8 @@ final protected static function assertBigDecimalInternalValues(string $unscaledV
*/
final protected static function assertBigRationalInternalValues(string $numerator, string $denominator, BigRational $actual) : void
{
self::assertSame($numerator, (string) $actual->getNumerator());
self::assertSame($denominator, (string) $actual->getDenominator());
self::assertSame($numerator, (string) $actual->getNumerator(), 'Numerator mismatch');
self::assertSame($denominator, (string) $actual->getDenominator(), 'Denominator mismatch');
}

/**
Expand Down

0 comments on commit 88500fc

Please sign in to comment.