improve decimal context
[awesomized/ext-ion] / tests / Decimal / Context / __construct.phpt
1 --TEST--
2 ion\Decimal\Context::__construct
3 --EXTENSIONS--
4 ion
5 --FILE--
6 TEST
7 <?php
8
9 use ion\Decimal\Context;
10
11 new Context(1,2,3,4,true);
12 try {
13 new Context(1,"bar",3,4,false);
14 } catch (Throwable $e) {
15 echo $e->getMessage(), "\n";
16 }
17 try {
18 new Context(false,false,false,false,false);
19 } catch (Throwable $e) {
20 echo $e->getMessage(), "\n";
21 }
22 try {
23 new Context(1,2);
24 } catch (Throwable $e) {
25 echo $e->getMessage(), "\n";
26 }
27 try {
28 new Context("foo");
29 } catch (Throwable $e) {
30 echo $e->getMessage(), "\n";
31 }
32 try {
33 new Context;
34 } catch (Throwable $e) {
35 echo $e->getMessage(), "\n";
36 }
37 ?>
38 DONE
39 --EXPECTF--
40 TEST
41 ion\Decimal\Context::__construct(): Argument #2 ($eMax) must be of type int, string given
42 ion\Decimal\Context::__construct() expects exactly 5 arguments, 2 given
43 ion\Decimal\Context::__construct() expects exactly 5 arguments, 1 given
44 ion\Decimal\Context::__construct() expects exactly 5 arguments, 0 given
45 DONE