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