diff options
author | Maat <maat-pub@mageia.biz> | 2020-05-08 18:29:30 +0200 |
---|---|---|
committer | Maat <maat-pub@mageia.biz> | 2020-05-08 21:36:04 +0200 |
commit | 36bc1870f21fac04736a1049c1d5b8e127d729f4 (patch) | |
tree | 9d102331eeaf1ef3cd23e656320d7c08e65757ed /tests/compress/compress_test.php | |
parent | 8875d385d0579b451dac4d9bda465172b4f69ee0 (diff) | |
parent | 149375253685b3a38996f63015a74b7a0f53aa14 (diff) | |
download | forums-36bc1870f21fac04736a1049c1d5b8e127d729f4.tar forums-36bc1870f21fac04736a1049c1d5b8e127d729f4.tar.gz forums-36bc1870f21fac04736a1049c1d5b8e127d729f4.tar.bz2 forums-36bc1870f21fac04736a1049c1d5b8e127d729f4.tar.xz forums-36bc1870f21fac04736a1049c1d5b8e127d729f4.zip |
Merge remote-tracking branch 'upstream/prep-release-3.1.11'
Diffstat (limited to 'tests/compress/compress_test.php')
-rw-r--r-- | tests/compress/compress_test.php | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/tests/compress/compress_test.php b/tests/compress/compress_test.php index ce193cf3ba..56c406b206 100644 --- a/tests/compress/compress_test.php +++ b/tests/compress/compress_test.php @@ -1,11 +1,15 @@ <?php /** - * - * @package testing - * @copyright (c) 2012 phpBB Group - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 - * - */ +* +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; require_once dirname(__FILE__) . '/../../phpBB/includes/functions_admin.php'; @@ -25,6 +29,12 @@ class phpbb_compress_test extends phpbb_test_case 'dir/subdir/4.txt', ); + protected $conflicts = array( + '1_1.txt', + '1_2.txt', + 'dir/2_1.txt', + ); + protected function setUp() { // Required for compress::add_file @@ -88,6 +98,11 @@ class phpbb_compress_test extends phpbb_test_case ); $compress->add_custom_file($this->path . 'dir/3.txt', 'dir/3.txt'); $compress->add_data(file_get_contents($this->path . 'dir/subdir/4.txt'), 'dir/subdir/4.txt'); + + // Add multiples of the same file to check conflicts are handled + $compress->add_file($this->path . '1.txt', $this->path); + $compress->add_file($this->path . '1.txt', $this->path); + $compress->add_file($this->path . 'dir/2.txt', $this->path); } protected function valid_extraction($extra = array()) @@ -150,7 +165,7 @@ class phpbb_compress_test extends phpbb_test_case $compress->mode = 'r'; $compress->open(); $compress->extract('tests/compress/' . self::EXTRACT_DIR); - $this->valid_extraction(); + $this->valid_extraction($this->conflicts); } /** @@ -168,6 +183,6 @@ class phpbb_compress_test extends phpbb_test_case $compress = new compress_zip('r', $zip); $compress->extract('tests/compress/' . self::EXTRACT_DIR); - $this->valid_extraction(); + $this->valid_extraction($this->conflicts); } } |