File: parse_file_not_existing.phpt

package info (click to toggle)
php-ast 1.1.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 632 kB
  • sloc: ansic: 2,173; xml: 621; php: 319; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 397 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--TEST--
ast\parse_file() on file that does not exist
--FILE--
<?php

try {
    ast\parse_file(__DIR__ . '/non_existing_file.php', $version=70);
} catch (RuntimeException $e) {
    echo $e, "\n";
}

?>
--EXPECTF--
RuntimeException: ast\parse_file(%stests/non_existing_file.php): %sailed to open stream: No such file or directory in %s:%d
Stack trace:
#0 %s(%d): ast\parse_file('%s', %d)
#1 {main}