Commit Graph

452 Commits

Author SHA1 Message Date
Greg Beaver
7ee3597851 increase code coverage 2008-04-21 16:56:45 +00:00
Greg Beaver
7d218cab35 cosmetics: same case as other tests 2008-04-21 16:42:24 +00:00
Greg Beaver
44358edd8d new test for non-executable zip named as phar 2008-04-21 16:39:11 +00:00
Greg Beaver
779fec2278 implement opendir for mounted directories - much simpler to do than I initially thought 2008-04-21 16:29:09 +00:00
Greg Beaver
afa1439304 finish code coverage for tar file format 2008-04-21 06:46:40 +00:00
Greg Beaver
c4315bfb2b add test for huge filenames, fix huge filename reading 2008-04-21 06:33:49 +00:00
Greg Beaver
1f6292e91d new test for corrupted tar with hard link to nowhere 2008-04-21 06:21:09 +00:00
Greg Beaver
3d858f4aa9 implement symbolic link support within a tar-based phar archive
this also resulted in a major fix for mounted directories, which were recycling the 'link' field which
could cause stupid conflicts with actual links, so move that to new 'tmp' field.
2008-04-21 06:17:51 +00:00
Greg Beaver
f70d527661 use a tar generated by the tar command to test links. Test still fails 2008-04-20 21:48:30 +00:00
Greg Beaver
ca6f70c8a3 add test for symbolic and hard links 2008-04-20 17:59:14 +00:00
Greg Beaver
027180d6ee new test for bad checksum, fix tar.c to catch tar archives with a corrupted first entry, fix memleak on bad checksum 2008-04-20 17:28:54 +00:00
Greg Beaver
4abe1a0978 fix tests to match CVS 2008-04-20 17:19:24 +00:00
Greg Beaver
f5dbaf64fc add failing test for truncated tar archive 2008-04-20 15:12:09 +00:00
Greg Beaver
8001dfd8d0 new test, increases code coverage slightly 2008-04-20 14:54:05 +00:00
Greg Beaver
5e5dd15d52 fix test to be OS-agnostic 2008-04-20 05:50:40 +00:00
Greg Beaver
41d9dde1df re-adding as binary 2008-04-20 05:49:06 +00:00
Greg Beaver
7cc7bdded7 added as text, removing in order to re-add 2008-04-20 05:48:52 +00:00
Greg Beaver
56650fa4cd amend zip test to actually test file perms creation/reading and fix severely broken permissions creation 2008-04-20 05:41:41 +00:00
Greg Beaver
4336865bb4 add new test for openoffice-created zip 2008-04-20 05:22:02 +00:00
Greg Beaver
0cf701fe4e new test for unix 'zip' command-created zip archives 2008-04-20 05:19:20 +00:00
Greg Beaver
50962003e0 fix fopen test problem - behavior is slightly different from PHP 5.2 -> PHP 5.3
now all tests pass on windows on my box
2008-04-20 04:35:14 +00:00
Greg Beaver
e94aaeada9 new test for unsupported compression versions, vastly enhance error messages on unsupported compression methods, fix memleak 2008-04-19 06:18:13 +00:00
Greg Beaver
aa61e6066c new tests for corrupted zips 2008-04-19 05:58:40 +00:00
Greg Beaver
0d1e0b4311 new test for zip archives with files created from stdin 2008-04-19 05:53:57 +00:00
Greg Beaver
78c55d2f6d new test for encrypted zips 2008-04-19 05:51:10 +00:00
Greg Beaver
d3a4ecf5ab new test for central directory offset being wrong 2008-04-19 05:45:10 +00:00
Greg Beaver
bd3ddde29f new test for truncated file comment, fix memleak found by test 2008-04-19 05:39:42 +00:00
Greg Beaver
4e98585ff7 new corrupt zip test 2008-04-19 05:35:03 +00:00
Greg Beaver
531caa6393 new test for corrupted zip with mis-matched entry counts, and fix memleaks in this test case 2008-04-19 05:30:48 +00:00
Greg Beaver
410ce457ab add utility for creating corrupted zip archives for testing purposes 2008-04-19 05:15:24 +00:00
Greg Beaver
c4f502fae0 COMPLETELY rework filename extension detection. Now the only requirements are:
1 - executable phars must contain '.phar' in the filename
2 - non-executable phars must not contain '.phar' and must have an extension of at least 1 character

In addition, phar filenames must exist if opened for read, and the directory containing the phar must exist if opened for creation
if opened for creation, the file must not already exist
[DOC]
2008-04-18 04:13:13 +00:00
Greg Beaver
a3e723b935 add failing tests for compression of zip files internally 2008-04-16 20:15:19 +00:00
Greg Beaver
31e6629895 fix large zip test 2008-04-16 20:08:02 +00:00
Greg Beaver
8bc9ec5466 make test OS-agnostic 2008-04-16 19:47:41 +00:00
Greg Beaver
4e584728e5 fix end of directory locator detection code, add failing test for large zips 2008-04-16 04:34:25 +00:00
Greg Beaver
398bcf4dd0 fix test - metadata works now 2008-04-16 04:16:20 +00:00
Greg Beaver
f513caa0a6 add failing test for metadata support in zip archives 2008-04-16 04:11:14 +00:00
Greg Beaver
6eabae560b increase code coverage 2008-04-16 03:55:13 +00:00
Greg Beaver
21b84bb728 forgot F in EXPECTF 2008-04-16 03:54:06 +00:00
Greg Beaver
cd9ecb53ae increase code coverage 2008-04-16 03:54:05 +00:00
Greg Beaver
6387155b3d add another test for alias overloading and make sure we disallow it when passed in constructor 2008-04-16 03:42:29 +00:00
Greg Beaver
ae3837851a fix tests so $Revision$ does not screw with things 2008-04-16 03:27:45 +00:00
Greg Beaver
6c0564c721 increase code coverage for phpinfo(), rework CLI phpinfo for phar.extract_list to be legible 2008-04-16 03:26:20 +00:00
Greg Beaver
a12dc0ba3d increase code coverage 2008-04-15 23:46:44 +00:00
Greg Beaver
277ba45f8f re-add as binary 2008-04-15 19:26:35 +00:00
Greg Beaver
bf716e8e98 aha - added as ascii, removing in order to re-add 2008-04-15 19:25:46 +00:00
Greg Beaver
2d6ad98ed9 this was corrupted on my windows box. $1m question: is this newly regenerated phar valid on Steph's box and my unix box?
withphar.phpt and withphar_web.phpt use it
2008-04-15 19:25:06 +00:00
Greg Beaver
189b936ba3 fix test on windows 2008-04-15 18:41:03 +00:00
Greg Beaver
df32c25175 forgot to commit this yesterday - make error message test PHP-version agnostic 2008-04-15 18:33:47 +00:00
Steph Fox
cdabebdb98 - Clean files that actually exist ;) 2008-04-15 14:34:16 +00:00
Greg Beaver
859bd13d09 add interception for readfile [DOC] 2008-04-15 03:36:57 +00:00
Greg Beaver
a8d822ed16 fix test to be OS-agnostic 2008-04-14 22:50:52 +00:00
Greg Beaver
e7a8df1248 fixes test on windows. Does it break on unix? the shadow knows 2008-04-14 22:27:34 +00:00
Greg Beaver
3cd16d46c9 fix test on windows 2008-04-14 22:22:04 +00:00
Greg Beaver
9f86ad6142 fix test 2008-04-14 18:35:10 +00:00
Greg Beaver
24b6df944d complete rename code coverage tests, completely re-do errors (why are the streams funcs so dang inconsistent in error handling/return values?) 2008-04-14 18:33:12 +00:00
Greg Beaver
0c9fcac767 remove redundant check for file existence, add another unlink edgecase test 2008-04-14 18:03:57 +00:00
Greg Beaver
bf701fe74f disallow unlink() on extracted phars (the idea is that it is a read-only for execute thing), add tests for unlink edge cases 2008-04-14 17:54:38 +00:00
Greg Beaver
4cd9806d06 add stat test for root dir 2008-04-14 17:40:46 +00:00
Greg Beaver
754a3b9a76 add tests for extract_list and stat 2008-04-14 17:39:46 +00:00
Greg Beaver
3703d9195d nuke potential segfault in phar_open_url, remove mem leaks due to error logging in phar_wrapper_stat, add to test case 2008-04-14 17:36:48 +00:00
Greg Beaver
0828c08abc add test case for SEEK_CUR fseek 2008-04-14 17:24:39 +00:00
Greg Beaver
65e04335a6 add test case for inability to open extract_list file 2008-04-14 17:21:49 +00:00
Greg Beaver
e9de3a285d 2 more test coverage edge cases down 2008-04-14 17:19:55 +00:00
Greg Beaver
f3f9f52af9 minor re-factoring of phar_open_url to remove one nested brackets, put fopen edge cases in its own test, tweak test phar file names 2008-04-14 17:18:58 +00:00
Greg Beaver
6d06058e81 add test coverage for fopen() with append mode 2008-04-14 16:38:58 +00:00
Greg Beaver
abb0766b8f add phar.extract_list test coverage for opendir 2008-04-14 16:34:11 +00:00
Greg Beaver
19e4a6113f add test coverage for phar.extract_list and mkdir/rmdir 2008-04-14 16:30:55 +00:00
Greg Beaver
eb252c5c92 fix potential segfault if some idiot tries to remove the root directory of a phar, add creation of root directory to test 2008-04-14 16:26:01 +00:00
Greg Beaver
07e36f5cad increase code coverage further 2008-04-14 16:10:58 +00:00
Greg Beaver
e7cbf4ddfe add error message on attempt to rmdir/mkdir 'phar://', add to test 2008-04-14 16:04:11 +00:00
Greg Beaver
2c0e0e1a96 update tests to ensure all temp files are erased, and to current error messages 2008-04-14 15:58:12 +00:00
Greg Beaver
61a9b7d8ee increase code coverage slightly 2008-04-14 15:52:57 +00:00
Greg Beaver
dbf43f5e0d add test for mkdir() of sub-directory of existing file, and restore the removed free()s with an is_temp_dir test 2008-04-14 15:48:25 +00:00
Greg Beaver
4b5079f4b7 increase test coverage of phar_wrapper_mkdir, fix segfault when mkdir() on existing directory 2008-04-14 15:46:06 +00:00
Greg Beaver
2277396fe3 fix edge case where a new phar is created via mkdir(), add to dir.phpt test 2008-04-14 15:21:41 +00:00
Greg Beaver
e69ea0731d more test coverage and fixes from increased coverage to opendir(). dir.phpt fails, but for wrong reasons (bug uncovered that needs fix) 2008-04-14 04:44:04 +00:00
Greg Beaver
aee1be851e add fstat to 027 test. Remove phar_dir_stat, stat should not be possible on a dir handle 2008-04-13 23:57:44 +00:00
Greg Beaver
61f439c1ad add to 027 test (for code coverage) of fwrite on dir handle 2008-04-13 23:48:46 +00:00
Greg Beaver
6f6a6dcb0e 100% code coverage for dir handle seeking, remove error log (not used in dir seeking, causes leak), update 027 test to have seeking test 2008-04-13 23:46:15 +00:00
Greg Beaver
c22b6a76ed add test for stat interception, fix stat interception 2008-04-13 23:33:31 +00:00
Greg Beaver
dc4da5e2f9 make tests php version-agnostic with regards to stream errors 2008-04-13 21:31:46 +00:00
Greg Beaver
02bbb72f6d add test for fopen interception, fix fopen interception 2008-04-13 20:46:45 +00:00
Greg Beaver
24d5595a8f add test for file_get_contents interception, fix file_get_contents interception 2008-04-13 19:36:33 +00:00
Greg Beaver
72daaf1d44 add test for opendir, fix bugs found 2008-04-12 22:21:29 +00:00
Greg Beaver
0814b2df09 fix build if SPL is disabled 2008-04-12 21:43:39 +00:00
Greg Beaver
b0f281b159 restore Phar->compress/decompress() to simplify $phar->convertToExecutable(NULL, Phar::GZ) to $phar->compress(Phar::GZ)
[DOC]
2008-04-11 13:41:59 +00:00
Greg Beaver
3493fb6561 combine PharFileInfo->setCompressedGZ/setCompressedBZIP2 into compress() with parameter Phar::GZ or Phar::BZ2
use ZEND_ACC_PUBLIC in PharFileInfo definitions, to be consistent
[DOC]
2008-04-11 13:26:03 +00:00
Greg Beaver
ab34fcac05 merge PharFileInfo->isCompressed/isCompressedGZ/isCompressedBZIP2 by adding an
optional parameter to isCompressed for testing specific compression algorithm
[DOC]
2008-04-11 13:07:14 +00:00
Greg Beaver
c07a07ea68 change PharFileInfo->setUncompressed to decompress
[DOC]
2008-04-11 12:56:53 +00:00
Greg Beaver
c0d82e966f refactor compress/convertToTar/convertToPhar/convertToZip/convertToExecutable/convertToData
into 2 methods:
convertToExecutable/convertToData.  Both methods accept 3 optional parameters
1 archive type, Phar::PHAR, Phar::TAR, or Phar::ZIP
2 compression Phar::NONE, Phar::GZ, or Phar::BZ2
3 file extension.  Default is <format>.<compression> where .phar.tar is executable .tar
convertToExecutable always returns a Phar object
convertToData always returns a PharData object
also added Phar::PHAR, Phar::TAR, and Phar::ZIP class constants
[DOC]
2008-04-11 04:20:15 +00:00
Greg Beaver
f0ff6fb109 s/getContents/getContent/ 2008-04-10 13:41:29 +00:00
Greg Beaver
61b5fc48e3 re-factor all-file compression. Remove compressAllFilesGZ/compressAllFilesBZ2 in favor of
unifying compressFiles which accepts Phar::GZ or Phar::BZ2 as argument.  rename uncompressAllFiles to decompressFiles
2008-04-10 13:40:26 +00:00
Greg Beaver
06df9bff83 add Phar->isWritable() for detecting whether a phar archive can be written to based on phar.readonly combined with actual file permissions
[DOC]
2008-04-10 03:32:10 +00:00
Greg Beaver
1c3097fcbe make built-in SplFileInfo->isWriteable() work for PharFileInfo as well, by ensuring phar->is_writeable is set/reset when phar.readonly is changed 2008-04-10 03:12:08 +00:00
Greg Beaver
abfc228f36 add addFile/addFromString/addEmptyDir. API is identical to ext/zip
[DOC]
2008-04-09 19:23:31 +00:00
Greg Beaver
e56beeeefd add PharFileInfo->getContents() to retrieve file contents
[DOC]
2008-04-09 18:12:41 +00:00
Greg Beaver
2e9fca4f0b fix read/write for PharData object, update tests to current API 2008-03-24 03:01:31 +00:00
Greg Beaver
b4b890cb8f check for invalid aliases, add tests for this and direct setting of stub/alias 2008-03-24 01:33:30 +00:00
Greg Beaver
95eeee9156 not all tests have been converted over to the new API, but it works
conversion is now split into 3 separate methods
1\) convertToZip\(\) convertToTar\(\) and convertToPhar\(\) exclusively change file format
2\) compress\(\) sets compression, accepting Phar::GZ, Phar::BZ2, or Phar::NONE
3\) convertToExecutable\(\) allows stub creation in tar/zip, convertToData\(\) prevents it

all methods return either Phar or PharData objects, allowing fluent interface.

only 1 test has been converted to the new format, but the API works
2008-03-23 22:42:45 +00:00