summaryrefslogtreecommitdiffstats
path: root/trader-tests.patch
diff options
context:
space:
mode:
Diffstat (limited to 'trader-tests.patch')
-rw-r--r--trader-tests.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/trader-tests.patch b/trader-tests.patch
new file mode 100644
index 0000000..c774f13
--- /dev/null
+++ b/trader-tests.patch
@@ -0,0 +1,43 @@
+--- pecl/trader/trunk/tests/trader_bbands_01.phpt 2021/01/17 21:07:36 352308
++++ pecl/trader/trunk/tests/trader_bbands_01.phpt 2021/01/18 07:21:15 352309
+@@ -3,6 +3,8 @@
+ --SKIPIF--
+ <?php
+ if (!extension_loaded("trader")) die("skip");
++if (PHP_VERSION_ID >= 80000) die ("skip PHP 7 only");
++?>
+ --INI--
+ trader.real_precision=3
+ --FILE--
+@@ -1464,4 +1466,4 @@
+ [251]=>
+ float(2.6519196935811E+37)
+ }
+-}
+\ No newline at end of file
++}
+--- pecl/trader/trunk/tests/trader_ini_01.phpt 2021/01/17 21:07:36 352308
++++ pecl/trader/trunk/tests/trader_ini_01.phpt 2021/01/18 07:21:15 352309
+@@ -35,7 +35,12 @@
+ ini_set('trader.real_round_mode', 'schnitzel');
+ var_dump(ini_get('trader.real_round_mode'));
+
+-ini_set('trader.real_round_mode', array());
++try {
++ // Hide warning for PHP 7
++ @ini_set('trader.real_round_mode', array());
++} catch (TypeError $e) {
++ // Hide exception for PHP 8
++}
+ var_dump(ini_get('trader.real_round_mode'));
+
+ ini_set('trader.real_round_mode', 42);
+@@ -55,8 +60,6 @@
+
+ Warning: ini_set(): Invalid value 'schnitzel' for trader.real_round_mode in %strader_ini_01.php on line %d
+ string(8) "half_odd"
+-
+-Warning: ini_set() expects parameter 2 to be string, array given in %strader_ini_01.php on line %d
+ string(8) "half_odd"
+
+ Warning: ini_set(): Invalid value '42' for trader.real_round_mode in %strader_ini_01.php on line %d