ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
BugHonorFileTimeTest.php
Go to the documentation of this file.
1<?php
2declare(strict_types=1);
3
5
6use DateTime;
7use PHPUnit\Framework\TestCase;
10 File
11};
13
14use function fopen;
15
20class BugHonorFileTimeTest extends TestCase
21{
22 public function testHonorsFileTime(): void
23 {
24 $archiveOpt = new Archive();
25 $fileOpt = new File();
26 $expectedTime = new DateTime('2019-04-21T19:25:00-0800');
27
28 $archiveOpt->setOutputStream(fopen('php://memory', 'wb'));
29 $fileOpt->setTime(clone $expectedTime);
30
31 $zip = new ZipStream(null, $archiveOpt);
32
33 $zip->addFile('sample.txt', 'Sample', $fileOpt);
34
35 $zip->finish();
36
37 $this->assertEquals($expectedTime, $fileOpt->getTime());
38 }
39}
An exception for terminatinating execution or to throw for unit testing.
Class Version \Option.
Definition: Bigint.php:4