Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions ext/bcmath/tests/bcadd_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ bcmath

try {
bcadd('a', '1');
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
} catch (\Throwable $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}

try {
bcadd('1', 'a');
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
} catch (\Throwable $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}

?>
--EXPECT--
bcadd(): Argument #1 ($num1) is not well-formed
bcadd(): Argument #2 ($num2) is not well-formed
ValueError: bcadd(): Argument #1 ($num1) is not well-formed
ValueError: bcadd(): Argument #2 ($num2) is not well-formed
8 changes: 4 additions & 4 deletions ext/bcmath/tests/bcceil_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ bcmath
try {
bcceil('hoge');
} catch (Throwable $e) {
echo $e->getMessage()."\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

try {
bcceil('0.00.1');
} catch (Throwable $e) {
echo $e->getMessage()."\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
bcceil(): Argument #1 ($num) is not well-formed
bcceil(): Argument #1 ($num) is not well-formed
ValueError: bcceil(): Argument #1 ($num) is not well-formed
ValueError: bcceil(): Argument #1 ($num) is not well-formed
12 changes: 6 additions & 6 deletions ext/bcmath/tests/bccomp_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ bcmath

try {
bccomp('a', '1');
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
} catch (\Throwable $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}

try {
bccomp('1', 'a');
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
} catch (\Throwable $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}

?>
--EXPECT--
bccomp(): Argument #1 ($num1) is not well-formed
bccomp(): Argument #2 ($num2) is not well-formed
ValueError: bccomp(): Argument #1 ($num1) is not well-formed
ValueError: bccomp(): Argument #2 ($num2) is not well-formed
18 changes: 9 additions & 9 deletions ext/bcmath/tests/bcdiv_error1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ bcmath
<?php
try {
bcdiv('10.99', '0');
} catch (DivisionByZeroError $ex) {
echo $ex->getMessage(), PHP_EOL;
} catch (Throwable $ex) {
echo $ex::class, ': ', $ex->getMessage(), "\n";
}

try {
bcdiv('10.99', '0.00');
} catch (DivisionByZeroError $ex) {
echo $ex->getMessage(), PHP_EOL;
} catch (Throwable $ex) {
echo $ex::class, ': ', $ex->getMessage(), "\n";
}

try {
bcdiv('10.99', '-0.00');
} catch (DivisionByZeroError $ex) {
echo $ex->getMessage(), PHP_EOL;
} catch (Throwable $ex) {
echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
Division by zero
Division by zero
Division by zero
DivisionByZeroError: Division by zero
DivisionByZeroError: Division by zero
DivisionByZeroError: Division by zero
12 changes: 6 additions & 6 deletions ext/bcmath/tests/bcdiv_error2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ bcmath

try {
bcdiv('a', '1');
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
} catch (\Throwable $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}

try {
bcdiv('1', 'a');
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
} catch (\Throwable $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}

?>
--EXPECT--
bcdiv(): Argument #1 ($num1) is not well-formed
bcdiv(): Argument #2 ($num2) is not well-formed
ValueError: bcdiv(): Argument #1 ($num1) is not well-formed
ValueError: bcdiv(): Argument #2 ($num2) is not well-formed
8 changes: 4 additions & 4 deletions ext/bcmath/tests/bcfloor_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ bcmath
try {
bcfloor('hoge');
} catch (Throwable $e) {
echo $e->getMessage()."\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

try {
bcfloor('0.00.1');
} catch (Throwable $e) {
echo $e->getMessage()."\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
bcfloor(): Argument #1 ($num) is not well-formed
bcfloor(): Argument #1 ($num) is not well-formed
ValueError: bcfloor(): Argument #1 ($num) is not well-formed
ValueError: bcfloor(): Argument #1 ($num) is not well-formed
18 changes: 9 additions & 9 deletions ext/bcmath/tests/bcmod_error2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ bcmath.scale=0
<?php
try {
bcmod("10", "0");
} catch (DivisionByZeroError $ex) {
echo $ex->getMessage(), PHP_EOL;
} catch (Throwable $ex) {
echo $ex::class, ': ', $ex->getMessage(), "\n";
}
try {
bcmod("10", "0.000");
} catch (DivisionByZeroError $ex) {
echo $ex->getMessage(), PHP_EOL;
} catch (Throwable $ex) {
echo $ex::class, ': ', $ex->getMessage(), "\n";
}
try {
bcmod("10", "-0.0");
} catch (DivisionByZeroError $ex) {
echo $ex->getMessage(), PHP_EOL;
} catch (Throwable $ex) {
echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
Modulo by zero
Modulo by zero
Modulo by zero
DivisionByZeroError: Modulo by zero
DivisionByZeroError: Modulo by zero
DivisionByZeroError: Modulo by zero
12 changes: 6 additions & 6 deletions ext/bcmath/tests/bcmod_error3.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ bcmath

try {
bcmod('a', '1');
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
} catch (\Throwable $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}

try {
bcmod('1', 'a');
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
} catch (\Throwable $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}

?>
--EXPECT--
bcmod(): Argument #1 ($num1) is not well-formed
bcmod(): Argument #2 ($num2) is not well-formed
ValueError: bcmod(): Argument #1 ($num1) is not well-formed
ValueError: bcmod(): Argument #2 ($num2) is not well-formed
12 changes: 6 additions & 6 deletions ext/bcmath/tests/bcmul_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ bcmath

try {
bcmul('a', '1');
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
} catch (\Throwable $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}

try {
bcmul('1', 'a');
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
} catch (\Throwable $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}

?>
--EXPECT--
bcmul(): Argument #1 ($num1) is not well-formed
bcmul(): Argument #2 ($num2) is not well-formed
ValueError: bcmul(): Argument #1 ($num1) is not well-formed
ValueError: bcmul(): Argument #2 ($num2) is not well-formed
16 changes: 8 additions & 8 deletions ext/bcmath/tests/bcpow_div_by_zero.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ foreach ($baseNumbers as $baseNumber) {
foreach ($exponents as $exponent) {
try {
echo bcpow($baseNumber, $exponent), "\n";
} catch (Error $e) {
echo $e->getMessage(), "\n";
} catch (Throwable $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}
}
}

?>
--EXPECT--
Negative power of zero
Negative power of zero
Negative power of zero
Negative power of zero
Negative power of zero
Negative power of zero
DivisionByZeroError: Negative power of zero
DivisionByZeroError: Negative power of zero
DivisionByZeroError: Negative power of zero
DivisionByZeroError: Negative power of zero
DivisionByZeroError: Negative power of zero
DivisionByZeroError: Negative power of zero
12 changes: 6 additions & 6 deletions ext/bcmath/tests/bcpow_error1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ bcmath
<?php
try {
var_dump(bcpow('1', '1.1', 2));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
} catch (\Throwable $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(bcpow('1', '0.1', 2));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
} catch (\Throwable $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
bcpow(): Argument #2 ($exponent) cannot have a fractional part
bcpow(): Argument #2 ($exponent) cannot have a fractional part
ValueError: bcpow(): Argument #2 ($exponent) cannot have a fractional part
ValueError: bcpow(): Argument #2 ($exponent) cannot have a fractional part
12 changes: 6 additions & 6 deletions ext/bcmath/tests/bcpow_error2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ bcmath
<?php
try {
var_dump(bcpow('0', '9223372036854775808', 2));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
} catch (\Throwable $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}

try {
var_dump(bcpow('0', '-9223372036854775808', 2));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
} catch (\Throwable $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
bcpow(): Argument #2 ($exponent) is too large
bcpow(): Argument #2 ($exponent) is too large
ValueError: bcpow(): Argument #2 ($exponent) is too large
ValueError: bcpow(): Argument #2 ($exponent) is too large
12 changes: 6 additions & 6 deletions ext/bcmath/tests/bcpow_error3.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ bcmath

try {
bcpow('a', '1');
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
} catch (\Throwable $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}

try {
bcpow('1', 'a');
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
} catch (\Throwable $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}

?>
--EXPECT--
bcpow(): Argument #1 ($num) is not well-formed
bcpow(): Argument #2 ($exponent) is not well-formed
ValueError: bcpow(): Argument #1 ($num) is not well-formed
ValueError: bcpow(): Argument #2 ($exponent) is not well-formed
18 changes: 9 additions & 9 deletions ext/bcmath/tests/bcpowmod_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@ bcmath

try {
bcpowmod('a', '1', '1');
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
} catch (\Throwable $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}

try {
bcpowmod('1', 'a', '1');
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
} catch (\Throwable $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}

try {
bcpowmod('1', '1', 'a');
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
} catch (\Throwable $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}

?>
--EXPECT--
bcpowmod(): Argument #1 ($num) is not well-formed
bcpowmod(): Argument #2 ($exponent) is not well-formed
bcpowmod(): Argument #3 ($modulus) is not well-formed
ValueError: bcpowmod(): Argument #1 ($num) is not well-formed
ValueError: bcpowmod(): Argument #2 ($exponent) is not well-formed
ValueError: bcpowmod(): Argument #3 ($modulus) is not well-formed
6 changes: 3 additions & 3 deletions ext/bcmath/tests/bcpowmod_negative_exponent.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ bcmath
<?php
try {
var_dump(bcpowmod('1', '-1', '2'));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
} catch (\Throwable $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
bcpowmod(): Argument #2 ($exponent) must be greater than or equal to 0
ValueError: bcpowmod(): Argument #2 ($exponent) must be greater than or equal to 0
6 changes: 3 additions & 3 deletions ext/bcmath/tests/bcpowmod_zero_modulus.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ bcmath
<?php
try {
var_dump(bcpowmod('1', '1', '0'));
} catch (DivisionByZeroError $ex) {
echo $ex->getMessage(), PHP_EOL;
} catch (Throwable $ex) {
echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
Modulo by zero
DivisionByZeroError: Modulo by zero
8 changes: 4 additions & 4 deletions ext/bcmath/tests/bcround_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ bcmath
try {
bcround('hoge');
} catch (Throwable $e) {
echo $e->getMessage()."\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

try {
bcround('0.00.1');
} catch (Throwable $e) {
echo $e->getMessage()."\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
bcround(): Argument #1 ($num) is not well-formed
bcround(): Argument #1 ($num) is not well-formed
ValueError: bcround(): Argument #1 ($num) is not well-formed
ValueError: bcround(): Argument #1 ($num) is not well-formed
Loading
Loading