summaryrefslogtreecommitdiff
path: root/ext/phar/tests/tar
Commit message (Collapse)AuthorAgeFilesLines
* Make Phar $fileNotFoundScript nullableNikita Popov2021-02-092-2/+2
| | | | | | | While "" is already treated the same way as absence, null is the logically correct default here. Making this one argument non-nullable is particularly pecular when considering that the preceding $alias and $index arguments are both nullable.
* Promote warnings to exceptions in ext/pharMáté Kocsis2020-08-251-6/+14
| | | | Closes GH-6008
* Skip bug70417.phpt if lsof output looks wrongNikita Popov2020-08-101-0/+3
| | | | | On alpine lsof accepts -p but it doesn't actually do anything. Add a crude check for whether lsof looks like Linux lsof.
* Fixup phar testNikita Popov2020-08-101-1/+0
|
* Add many missing closing PHP tags to testsMáté Kocsis2020-08-091-1/+0
| | | | Closes GH-5958
* [RFC] Only unserialize Phar metadata when getMetadata() is calledTyson Andre2020-08-032-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In other words, don't automatically unserialize when the magic phar:// stream wrappers are used. RFC: https://wiki.php.net/rfc/phar_stop_autoloading_metadata Also, change the signature from `getMetadata()` to `getMetadata(array $unserialize_options = [])`. Start throwing earlier if setMetadata() is called and serialization threw. See https://externals.io/message/110856 and https://bugs.php.net/bug.php?id=76774 This was refactored to add a phar_metadata_tracker for the following reasons: - The way to properly copy a zval was previously implicit and undocumented (e.g. is it a pointer to a raw string or an actual value) - Avoid unnecessary serialization and unserialization in the most common case - If a metadata value is serialized once while saving a new/modified phar file, this allows reusing the same serialized string. - Have as few ways to copy/clone/lazily parse metadata (etc.) as possible, so that code changes can be limited to only a few places in the future. - Performance is hopefully not a concern - copying a string should be faster than unserializing a value, and metadata should be rare in most cases. Remove unnecessary skip in a test(Compression's unused) Add additional assertions about usage of persistent phars Improve robustness of `Phar*->setMetadata()` - Add sanity checks for edge cases freeing metadata, when destructors or serializers modify the phar recursively. - Typical use cases of php have phar.readonly=1 and would not be affected. Closes GH-5855
* Add --file-cache-prime/use options to run-testsNikita Popov2020-05-204-0/+4
| | | | | | | | --file-cache-prime populates the file cache, --file-cache-use uses the file cache. And fix a number of tests to run under file cache or disabled timestamp validation.
* Reindent phpt filesNikita Popov2020-02-0346-166/+166
|
* Fix #78880 Another roundMáté Kocsis2020-01-191-1/+1
|
* Make error messages more consistent by fixing capitalizationMáté Kocsis2020-01-1714-18/+18
| | | | Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
* Clean DONE tags from testsFabien Villepinte2019-11-0761-122/+0
| | | | | | | Remove most of the `===DONE===` tags and its variations. Keep `===DONE===` if the test output otherwise becomes empty. Closes GH-4872.
* Merge branch 'PHP-7.4'Peter Kokot2019-07-213-21/+7
|\ | | | | | | | | * PHP-7.4: Fix failed tests for phar
| * Fix failed tests for pharPeter Kokot2019-07-213-21/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - when $status is boolean, E_NOTICE appears and tests fail - opcache is never enabled on these tests anyway. - Add opcache.revalidate_freq=0 to testing script Instead of checking this in the tests files it can be used directly in the main testing script. Also this fixes failed tests. - Use opcache_invalidate() instead of sleep() delay in some tests. Some delays are still used since the opcache_invalidate seems to be buggy and not working as expected. Closes GH-4392
* | Merge branch 'PHP-7.4'Peter Kokot2019-06-301-1/+0
|\ \ | |/ | | | | | | | | * PHP-7.4: Fix phar tests with hash extension Fix missing file and remove SKIP section
| * Fix phar tests with hash extensionPeter Kokot2019-06-301-1/+0
| | | | | | | | | | | | | | - The hash extension is now always available. - Remove unfinished test The Phar::PGP currently doesn't exist yet.
* | Merge branch 'PHP-7.4'Peter Kokot2019-06-271-1/+1
|\ \ | |/ | | | | | | * PHP-7.4: Sync HAVE_HASH, HAVE_HASH_EXT, PHAR_HASH_OK symbols
| * Sync HAVE_HASH, HAVE_HASH_EXT, PHAR_HASH_OK symbolsPeter Kokot2019-06-271-1/+1
| | | | | | | | | | | | | | | | The hash extension is always available since PHP-7.4. The symbol HAVE_HASH_EXT is kept for BC reasons and removed in PHP-8.0. This patch also removes the PHAR_HASH_OK since it is no longer relevant.
* | Merge branch 'PHP-7.4'Peter Kokot2019-03-1568-230/+230
|\ \ | |/ | | | | | | * PHP-7.4: Replace dirname(__FILE__) by __DIR__ in tests
| * Replace dirname(__FILE__) by __DIR__ in testsFabien Villepinte2019-03-1568-230/+230
| |
* | Adjust tests for zpp TypeError changeNikita Popov2019-03-114-28/+8
| |
* | Merge branch 'PHP-7.4'Nikita Popov2019-02-222-11/+11
|\ \ | |/
| * Fix more file name collisions in phar testsNikita Popov2019-02-222-11/+11
| |
* | Merge branch 'PHP-7.4'Nikita Popov2019-02-222-18/+18
|\ \ | |/
| * Use separate files in phar testsNikita Popov2019-02-222-20/+20
| |
* | Remove support for __autoload()Nikita Popov2019-01-301-8/+6
|/ | | | | | | There are probably some improvements we can do to the SPL implementation now that __autoload() is gone. In particular having EG(autoload_func) as a property zend function, rather than a simple callback probably doesn't make sense.
* Remove some mentions of RECOVERABLE_ERROR in testsNikita Popov2018-11-152-12/+0
| | | | Mostly drop error handlers that are no longer necessary.
* Sync leading and final newlines in *.phpt sectionsPeter Kokot2018-10-1515-15/+7
| | | | | | | | | | | | | | | | | | | | | | | This patch adds missing newlines, trims multiple redundant final newlines into a single one, and trims redundant leading newlines in all *.phpt sections. According to POSIX, a line is a sequence of zero or more non-' <newline>' characters plus a terminating '<newline>' character. [1] Files should normally have at least one final newline character. C89 [2] and later standards [3] mention a final newline: "A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character." Although it is not mandatory for all files to have a final newline fixed, a more consistent and homogeneous approach brings less of commit differences issues and a better development experience in certain text editors and IDEs. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 [2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2 [3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
* Trim trailing whitespace in testsGabriel Caruso2018-10-1421-21/+21
|
* Sync leading and final newlines in source code filesPeter Kokot2018-10-144-4/+4
| | | | | | | | | | | | | | | | | | | | | | This patch adds missing newlines, trims multiple redundant final newlines into a single one, and trims redundant leading newlines. According to POSIX, a line is a sequence of zero or more non-' <newline>' characters plus a terminating '<newline>' character. [1] Files should normally have at least one final newline character. C89 [2] and later standards [3] mention a final newline: "A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character." Although it is not mandatory for all files to have a final newline fixed, a more consistent and homogeneous approach brings less of commit differences issues and a better development experience in certain text editors and IDEs. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 [2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2 [3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
* Make more tests run and fix SKIPIF sectionsGabriel Caruso2018-07-161-8/+3
|
* Merge branch 'PHP-7.2'Stanislav Malyshev2018-04-233-3/+3
|\ | | | | | | | | | | | | | | | | | | | | * PHP-7.2: Fix tsrm_ls Fix #76129 - remove more potential unfiltered outputs for phar Fix test Fix bug #76248 - Malicious LDAP-Server Response causes Crash Fix bug #76249 - fail on invalid sequences Fix #76130: Heap Buffer Overflow (READ: 1786) in exif_iif_add_value Fix bug #75981: prevent reading beyond buffer start
| * Merge branch 'PHP-7.1' into PHP-7.2Stanislav Malyshev2018-04-233-3/+3
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * PHP-7.1: Fix tsrm_ls Fix #76129 - remove more potential unfiltered outputs for phar Fix test Fix bug #76248 - Malicious LDAP-Server Response causes Crash Fix bug #76249 - fail on invalid sequences Fix #76130: Heap Buffer Overflow (READ: 1786) in exif_iif_add_value Fix bug #75981: prevent reading beyond buffer start
| | * Merge branch 'PHP-7.0' into PHP-7.1Stanislav Malyshev2018-04-233-3/+3
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * PHP-7.0: Fix tsrm_ls Fix #76129 - remove more potential unfiltered outputs for phar Fix test Fix bug #76248 - Malicious LDAP-Server Response causes Crash Fix bug #76249 - fail on invalid sequences Fix #76130: Heap Buffer Overflow (READ: 1786) in exif_iif_add_value Fix bug #75981: prevent reading beyond buffer start
| | | * Merge branch 'PHP-5.6' into PHP-7.0Stanislav Malyshev2018-04-233-3/+3
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * PHP-5.6: Fix tsrm_ls Fix #76129 - remove more potential unfiltered outputs for phar Fix test Fix bug #76248 - Malicious LDAP-Server Response causes Crash Fix bug #76249 - fail on invalid sequences Fix #76130: Heap Buffer Overflow (READ: 1786) in exif_iif_add_value Fix bug #75981: prevent reading beyond buffer start
| | | | * Fix #76129 - remove more potential unfiltered outputs for pharStanislav Malyshev2018-04-233-3/+3
| | | | |
* | | | | Use EXPECT instead of EXPECTF when possibleGabriel Caruso2018-02-205-5/+5
| | | | | | | | | | | | | | | | | | | | EXPECTF logic in run-tests.php is considerable, so let's avoid it.
* | | | | Remove trailing whitespace in inc filesGabriel Caruso2018-02-103-6/+6
| | | | |
* | | | | Use bool instead of boolean while throwing a type errorGabriel Caruso2018-02-044-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PHP requires boolean typehints to be written "bool" and disallows "boolean" as an alias. This changes the error messages to match the actual type name and avoids confusing messages like "must be of type boolean, boolean given". This a followup to ce1d69a1f6dcf15d43029301059c25e5bc09a577, which implements the same change for integer->int.
* | | | | Remove superfluous SKIPIF sections in more testsGabriel Caruso2018-02-0418-20/+2
|/ / / /
* | | | Merge branch 'PHP-7.1' into PHP-7.2Stanislav Malyshev2018-01-014-12/+12
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | * PHP-7.1: Update NEWS Fixed bug #75571: Potential infinite loop in gdImageCreateFromGifCtx Fix bug #74782: remove file name from output to avoid XSS
| * | | Merge branch 'PHP-7.0' into PHP-7.1Stanislav Malyshev2018-01-014-12/+12
| |\ \ \ | | |/ / | | | | | | | | | | | | | | | | | | | | * PHP-7.0: Update NEWS Fixed bug #75571: Potential infinite loop in gdImageCreateFromGifCtx Fix bug #74782: remove file name from output to avoid XSS
| | * | Merge branch 'PHP-5.6' into PHP-7.0Stanislav Malyshev2018-01-014-12/+12
| | |\ \ | | | |/ | | | | | | | | | | | | | | | | | | | | * PHP-5.6: Update NEWS Fixed bug #75571: Potential infinite loop in gdImageCreateFromGifCtx Fix bug #74782: remove file name from output to avoid XSS
| | | * Fix bug #74782: remove file name from output to avoid XSSStanislav Malyshev2018-01-014-12/+12
| | | |
* | | | Escape value passed to exec()Sara Golemon2017-06-011-1/+1
| | | | | | | | | | | | | | | | getmypid() is safe, but no harm being EXTRA safe.
* | | | Ignore spurious stderr output from lsofSara Golemon2017-06-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | lsof may report errors trying to stat files owned by other users in other processes, even when asking for files associated to a specific process. Boo.
* | | | Merge branch 'PHP-7.1'Anatol Belski2017-01-132-6/+0
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.1: fix remaining tests for Opcache runs
| * | | Merge branch 'PHP-7.0' into PHP-7.1Anatol Belski2017-01-132-6/+0
| |\ \ \ | | |/ / | | | | | | | | | | | | * PHP-7.0: fix remaining tests for Opcache runs
| | * | fix remaining tests for Opcache runsAnatol Belski2017-01-132-6/+0
| | | | | | | | | | | | | | | | | | | | The fail reason here is the TMP change while both top and test run same binary with opcache enabled.
* | | | Merge branch 'PHP-7.1'Christoph M. Becker2017-01-051-0/+36
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.1: Fix #70417: PharData::compress() doesn't close temp file
| * | | Merge branch 'PHP-7.0' into PHP-7.1Christoph M. Becker2017-01-051-0/+36
| |\ \ \ | | |/ / | | | | | | | | | | | | * PHP-7.0: Fix #70417: PharData::compress() doesn't close temp file