Skip to content

Commit e87a3c3

Browse files
committed
update test to test exception type
1 parent 7f88451 commit e87a3c3

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

ext/gmp/tests/gmp_powm_sec.phpt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,22 @@ foreach ([0, -1] as $exp) {
2525
try {
2626
var_dump(gmp_powm_sec(4, 13, 0));
2727
} catch (\DivisionByZeroError $e) {
28-
echo $e->getMessage(), \PHP_EOL;
28+
echo $e::class, ": ", $e->getMessage(), \PHP_EOL;
2929
}
3030

3131
try {
3232
var_dump(gmp_powm_sec(4, 13, 496));
3333
} catch (\ValueError $e) {
34-
echo $e->getMessage(), \PHP_EOL;
34+
echo $e::class, ": ", $e->getMessage(), \PHP_EOL;
3535
}
3636

3737
echo "Done\n";
3838
?>
3939
--EXPECT--
4040
string(3) "445"
4141
string(1) "5"
42-
gmp_powm_sec(): Argument #2 ($exponent) must be greater than 0
43-
gmp_powm_sec(): Argument #2 ($exponent) must be greater than 0
44-
gmp_powm_sec(): Argument #3 ($modulus) Modulo by zero
45-
gmp_powm_sec(): Argument #3 ($modulus) must be odd
42+
ValueError: gmp_powm_sec(): Argument #2 ($exponent) must be greater than 0
43+
ValueError: gmp_powm_sec(): Argument #2 ($exponent) must be greater than 0
44+
DivisionByZeroError: gmp_powm_sec(): Argument #3 ($modulus) Modulo by zero
45+
ValueError: gmp_powm_sec(): Argument #3 ($modulus) must be odd
4646
Done

0 commit comments

Comments
 (0)