summaryrefslogtreecommitdiff
path: root/ext/phar/tests/phar_create_in_cwd.phpt
diff options
context:
space:
mode:
authorGreg Beaver <cellog@php.net>2007-01-28 21:47:29 +0000
committerGreg Beaver <cellog@php.net>2007-01-28 21:47:29 +0000
commita51ded016007832a2a7ece28c2e4a35eb5b5913f (patch)
treede848ac963c464245c9520ea58c336cd8679a7c7 /ext/phar/tests/phar_create_in_cwd.phpt
parentb53229dae06fd84f9b675fd056c7da6547821848 (diff)
downloadphp-git-a51ded016007832a2a7ece28c2e4a35eb5b5913f.tar.gz
new test for creation of phar in current directory
Diffstat (limited to 'ext/phar/tests/phar_create_in_cwd.phpt')
-rw-r--r--ext/phar/tests/phar_create_in_cwd.phpt41
1 files changed, 41 insertions, 0 deletions
diff --git a/ext/phar/tests/phar_create_in_cwd.phpt b/ext/phar/tests/phar_create_in_cwd.phpt
new file mode 100644
index 0000000000..8545880565
--- /dev/null
+++ b/ext/phar/tests/phar_create_in_cwd.phpt
@@ -0,0 +1,41 @@
+--TEST--
+Phar: create a Phar with relative path
+--SKIPIF--
+<?php if (!extension_loaded("phar")) print "skip"; ?>
+--INI--
+phar.require_hash=0
+phar.readonly=0
+--FILE--
+<?php
+$p = new Phar('brandnewphar.phar');
+$p['file1.txt'] = 'hi';
+$p->commit();
+var_dump($p->getStub());
+$p->commit("<?php
+function __autoload(\$class)
+{
+ include 'phar://' . str_replace('_', '/', \$class);
+}
+Phar::mapPhar('brandnewphar.phar');
+include 'phar://brandnewphar.phar/startup.php';
+__HALT_COMPILER();
+?>");
+var_dump($p->getStub());
+?>
+===DONE===
+--CLEAN--
+<?php
+unlink(dirname(__FILE__) . '/brandnewphar.phar');
+?>
+--EXPECT--
+string(24) "<?php __HALT_COMPILER();"
+string(198) "<?php
+function __autoload($class)
+{
+ include 'phar://' . str_replace('_', '/', $class);
+}
+Phar::mapPhar('brandnewphar.phar');
+include 'phar://brandnewphar.phar/startup.php';
+__HALT_COMPILER();
+?>"
+===DONE=== \ No newline at end of file