xref: /PHP-5.3/ext/phar/tests/phar_running.phpt (revision 16b4d8e0)
1--TEST--
2Phar: Phar::running()
3--SKIPIF--
4<?php if (!extension_loaded("phar")) die("skip"); ?>
5--INI--
6phar.readonly=0
7--FILE--
8<?php
9$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
10$pname = 'phar://' . $fname;
11
12$phar = new Phar($fname);
13$phar['index.php'] = '<?php
14Phar::running(array());
15var_dump(Phar::running());
16var_dump(Phar::running(false));
17?>';
18include $pname . '/index.php';
19var_dump(Phar::running());
20?>
21===DONE===
22--CLEAN--
23<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
24--EXPECTF--
25Warning: Phar::running() expects parameter 1 to be boolean, array given in phar://%sphar_running.phar.php/index.php on line 2
26string(%d) "phar://%sphar_running.phar.php"
27string(%d) "%sphar_running.phar.php"
28string(0) ""
29===DONE===
30