mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
Merge branch 'MDL-37802-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE
This commit is contained in:
commit
1c55d84794
4 changed files with 32 additions and 1 deletions
BIN
lib/filestorage/tests/fixtures/passwordis1.zip
vendored
Normal file
BIN
lib/filestorage/tests/fixtures/passwordis1.zip
vendored
Normal file
Binary file not shown.
|
@ -525,6 +525,24 @@ class core_files_zip_packer_testcase extends advanced_testcase implements file_p
|
|||
unlink($archive);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test opening an encrypted archive
|
||||
*/
|
||||
public function test_open_encrypted_archive() {
|
||||
$this->resetAfterTest();
|
||||
|
||||
// The archive contains a single encrypted "hello.txt" file.
|
||||
$archive = __DIR__ . '/fixtures/passwordis1.zip';
|
||||
|
||||
/** @var zip_packer $packer */
|
||||
$packer = get_file_packer('application/zip');
|
||||
$result = $packer->extract_to_pathname($archive, make_temp_directory('zip'));
|
||||
|
||||
$this->assertIsArray($result);
|
||||
$this->assertArrayHasKey('hello.txt', $result);
|
||||
$this->assertEquals('Can not read file from zip archive', $result['hello.txt']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the progress reporting.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue