1
0
mirror of https://github.com/php/php-src.git synced 2026-04-05 07:02:33 +02:00
Files
archived-php-src/ext/phar/tests/phar_construct_invalidurl.phpt
Nikita Popov 7485978339 Migrate SKIPIF -> EXTENSIONS (#7138)
This is an automated migration of most SKIPIF extension_loaded checks.
2021-06-11 11:57:42 +02:00

29 lines
790 B
PHP

--TEST--
Phar object passed URL
--INI--
default_charset=UTF-8
--EXTENSIONS--
phar
--FILE--
<?php
try {
$a = new Phar('http://should.fail.com');
} catch (UnexpectedValueException $e) {
echo $e->getMessage(),"\n";
}
try {
$a = new Phar('http://');
} catch (UnexpectedValueException $e) {
echo $e->getMessage(),"\n";
}
try {
$a = new Phar('http:/');
} catch (UnexpectedValueException $e) {
echo $e->getMessage(),"\n";
}
?>
--EXPECT--
Cannot create a phar archive from a URL like "http://should.fail.com". Phar objects can only be created from local files
Cannot create a phar archive from a URL like "http://". Phar objects can only be created from local files
Cannot create phar 'http:/', file extension (or combination) not recognised or the directory does not exist