xref: /php-ast/tests/zpp_errors.phpt (revision e2362a9b)
1--TEST--
2zpp failures throw TypeError
3--FILE--
4<?php
5
6try { ast\parse_code(); }
7catch (TypeError $e) { echo $e->getMessage(), "\n"; }
8try { ast\parse_file(); }
9catch (TypeError $e) { echo $e->getMessage(), "\n"; }
10try { ast\get_kind_name(); }
11catch (TypeError $e) { echo $e->getMessage(), "\n"; }
12try { ast\kind_uses_flags(); }
13catch (TypeError $e) { echo $e->getMessage(), "\n"; }
14
15?>
16--EXPECTF--
17ast\parse_code() expects at least 1 %s, 0 given
18ast\parse_file() expects at least 1 %s, 0 given
19ast\get_kind_name() expects exactly 1 %s, 0 given
20ast\kind_uses_flags() expects exactly 1 %s, 0 given
21