2a96406017f1a79cd485e8921c6eef86040ef1b7
[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 use ion\Decimal\Context;
9
10 new Context;
11 new Context(32);
12 try {
13 new Context(123);
14 } catch (Throwable $e) {
15 echo $e->getMessage(), "\n";
16 }
17 try {
18 new Context("123");
19 } catch (Throwable $e) {
20 echo $e->getMessage(), "\n";
21 }
22 try {
23 new Context("foo");
24 } catch (Throwable $e) {
25 echo $e->getMessage(), "\n";
26 }
27 ?>
28 DONE
29 --EXPECTF--
30 TEST
31 Decimal context only allows 32, 64 or 128 bits
32 Decimal context only allows 32, 64 or 128 bits
33 ion\Decimal\Context::__construct(): Argument #1 ($bits) must be of type int, string given
34 DONE