summaryrefslogtreecommitdiff
path: root/ext/bcmath/tests/bcmod_error3.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bcmath/tests/bcmod_error3.phpt')
-rw-r--r--ext/bcmath/tests/bcmod_error3.phpt25
1 files changed, 25 insertions, 0 deletions
diff --git a/ext/bcmath/tests/bcmod_error3.phpt b/ext/bcmath/tests/bcmod_error3.phpt
new file mode 100644
index 0000000000..71718d3be8
--- /dev/null
+++ b/ext/bcmath/tests/bcmod_error3.phpt
@@ -0,0 +1,25 @@
+--TEST--
+bcmod() requires well-formed values
+--SKIPIF--
+<?php
+if (!extension_loaded('bcmath')) die('skip bcmath extension not available');
+?>
+--FILE--
+<?php
+
+try {
+ bcmod('a', '1');
+} catch (\ValueError $e) {
+ echo $e->getMessage() . PHP_EOL;
+}
+
+try {
+ bcmod('1', 'a');
+} catch (\ValueError $e) {
+ echo $e->getMessage() . PHP_EOL;
+}
+
+?>
+--EXPECT--
+bcmod(): Argument #1 ($num1) is not well-formed
+bcmod(): Argument #2 ($num2) is not well-formed