]> granicus.if.org Git - php/commitdiff
increase code coverage
authorGreg Beaver <cellog@php.net>
Sun, 12 Oct 2008 05:41:22 +0000 (05:41 +0000)
committerGreg Beaver <cellog@php.net>
Sun, 12 Oct 2008 05:41:22 +0000 (05:41 +0000)
ext/phar/tests/files/include_path.phar [new file with mode: 0644]
ext/phar/tests/files/include_path.phar.inc [new file with mode: 0644]
ext/phar/tests/files/include_path2.phar [new file with mode: 0644]
ext/phar/tests/include_path_advanced.phpt [new file with mode: 0644]

diff --git a/ext/phar/tests/files/include_path.phar b/ext/phar/tests/files/include_path.phar
new file mode 100644 (file)
index 0000000..50f698c
Binary files /dev/null and b/ext/phar/tests/files/include_path.phar differ
diff --git a/ext/phar/tests/files/include_path.phar.inc b/ext/phar/tests/files/include_path.phar.inc
new file mode 100644 (file)
index 0000000..85ef5a7
--- /dev/null
@@ -0,0 +1,19 @@
+<?php
+// test advanced example
+$phar = new Phar(dirname(__FILE__) . '/include_path.phar');
+$phar2 = new Phar(dirname(__FILE__) . '/include_path2.phar');
+$phar2['file1.php'] = 'file1.php
+';
+$phar2['test/file1.php'] = 'test/file1.php
+';
+$phar['hello/test.php'] = '<?php
+include "file1.php";';
+
+$phar->setStub("<?php
+set_include_path('.' . PATH_SEPARATOR . 'phar://' . dirname(__FILE__) . '/include_path2.phar' );
+include 'phar://' . __FILE__ . '/hello/test.php';
+set_include_path('.' . PATH_SEPARATOR . 'phar://' . dirname(__FILE__) . '/include_path2.phar/test');
+include 'phar://' . __FILE__ . '/hello/test.php';
+echo \"ok\\n\";
+__HALT_COMPILER();
+?>");
diff --git a/ext/phar/tests/files/include_path2.phar b/ext/phar/tests/files/include_path2.phar
new file mode 100644 (file)
index 0000000..7b7355f
Binary files /dev/null and b/ext/phar/tests/files/include_path2.phar differ
diff --git a/ext/phar/tests/include_path_advanced.phpt b/ext/phar/tests/include_path_advanced.phpt
new file mode 100644 (file)
index 0000000..6feee42
--- /dev/null
@@ -0,0 +1,12 @@
+--TEST--
+Phar: include_path advanced code coverage test
+--INI--
+default_charset=UTF-8
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--FILE_EXTERNAL--
+files/include_path.phar
+--EXPECT--
+file1.php
+test/file1.php
+ok
\ No newline at end of file