summaryrefslogtreecommitdiffstats
path: root/trader-tests.patch
blob: c774f13aa8fa7056da6d8be586544b2af78529a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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