Skip to content
Open
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
8 changes: 4 additions & 4 deletions ext/bcmath/tests/bcadd_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ bcmath
try {
bcadd('a', '1');
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

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

?>
--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
8 changes: 4 additions & 4 deletions ext/bcmath/tests/bccomp_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ bcmath
try {
bccomp('a', '1');
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

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

?>
--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
12 changes: 6 additions & 6 deletions ext/bcmath/tests/bcdiv_error1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ bcmath
try {
bcdiv('10.99', '0');
} catch (DivisionByZeroError $ex) {
echo $ex->getMessage(), PHP_EOL;
echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}

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

try {
bcdiv('10.99', '-0.00');
} catch (DivisionByZeroError $ex) {
echo $ex->getMessage(), PHP_EOL;
echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
?>
--EXPECT--
Division by zero
Division by zero
Division by zero
DivisionByZeroError: Division by zero
DivisionByZeroError: Division by zero
DivisionByZeroError: Division by zero
8 changes: 4 additions & 4 deletions ext/bcmath/tests/bcdiv_error2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ bcmath
try {
bcdiv('a', '1');
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

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

?>
--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
12 changes: 6 additions & 6 deletions ext/bcmath/tests/bcmod_error2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ bcmath.scale=0
try {
bcmod("10", "0");
} catch (DivisionByZeroError $ex) {
echo $ex->getMessage(), PHP_EOL;
echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
try {
bcmod("10", "0.000");
} catch (DivisionByZeroError $ex) {
echo $ex->getMessage(), PHP_EOL;
echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
try {
bcmod("10", "-0.0");
} catch (DivisionByZeroError $ex) {
echo $ex->getMessage(), PHP_EOL;
echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
?>
--EXPECT--
Modulo by zero
Modulo by zero
Modulo by zero
DivisionByZeroError: Modulo by zero
DivisionByZeroError: Modulo by zero
DivisionByZeroError: Modulo by zero
8 changes: 4 additions & 4 deletions ext/bcmath/tests/bcmod_error3.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ bcmath
try {
bcmod('a', '1');
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

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

?>
--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
8 changes: 4 additions & 4 deletions ext/bcmath/tests/bcmul_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ bcmath
try {
bcmul('a', '1');
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

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

?>
--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
14 changes: 7 additions & 7 deletions ext/bcmath/tests/bcpow_div_by_zero.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ foreach ($baseNumbers as $baseNumber) {
try {
echo bcpow($baseNumber, $exponent), "\n";
} catch (Error $e) {
echo $e->getMessage(), "\n";
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
8 changes: 4 additions & 4 deletions ext/bcmath/tests/bcpow_error1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ bcmath
try {
var_dump(bcpow('1', '1.1', 2));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(bcpow('1', '0.1', 2));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--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
8 changes: 4 additions & 4 deletions ext/bcmath/tests/bcpow_error2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ bcmath
try {
var_dump(bcpow('0', '9223372036854775808', 2));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

try {
var_dump(bcpow('0', '-9223372036854775808', 2));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--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
8 changes: 4 additions & 4 deletions ext/bcmath/tests/bcpow_error3.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ bcmath
try {
bcpow('a', '1');
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

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

?>
--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
12 changes: 6 additions & 6 deletions ext/bcmath/tests/bcpowmod_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ bcmath
try {
bcpowmod('a', '1', '1');
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

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

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

?>
--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
4 changes: 2 additions & 2 deletions ext/bcmath/tests/bcpowmod_negative_exponent.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ bcmath
try {
var_dump(bcpowmod('1', '-1', '2'));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--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
4 changes: 2 additions & 2 deletions ext/bcmath/tests/bcpowmod_zero_modulus.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ bcmath
try {
var_dump(bcpowmod('1', '1', '0'));
} catch (DivisionByZeroError $ex) {
echo $ex->getMessage(), PHP_EOL;
echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
?>
--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
12 changes: 6 additions & 6 deletions ext/bcmath/tests/bcround_precision_bounds.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ bcmath
try {
bcround('1', PHP_INT_MAX);
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
(new BcMath\Number('1'))->round(PHP_INT_MAX);
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
(new BcMath\Number('1'))->round(2147483648); // INT_MAX + 1
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
bcround(): Argument #2 ($precision) must be between %i and %d
BcMath\Number::round(): Argument #1 ($precision) must be between %i and %d
BcMath\Number::round(): Argument #1 ($precision) must be between %i and %d
ValueError: bcround(): Argument #2 ($precision) must be between %i and %d
ValueError: BcMath\Number::round(): Argument #1 ($precision) must be between %i and %d
ValueError: BcMath\Number::round(): Argument #1 ($precision) must be between %i and %d
Loading
Loading