1--TEST--
2Phar::buildFromDirectory() - non-directory passed as first parameter
3--SKIPIF--
4<?php
5    if (!extension_loaded("phar")) die("skip");
6    if (substr(PHP_OS, 0, 3) != "WIN") die("skip Windows only test");
7?>
8--INI--
9phar.require_hash=0
10phar.readonly=0
11--FILE--
12<?php
13try {
14    $phar = new Phar(__DIR__ . '/buildfromdirectory2.phar');
15    $phar->buildFromDirectory(1);
16} catch (Exception $e) {
17    var_dump(get_class($e));
18    echo $e->getMessage() . "\n";
19}
20?>
21--CLEAN--
22<?php
23unlink(__DIR__ . '/buildfromdirectory2.phar');
24__HALT_COMPILER();
25?>
26--EXPECTF--
27%s(24) "UnexpectedValueException"
28RecursiveDirectoryIterator::__construct(1): %s (code: 2)
29