addFromString($localFile, 'contents'); static::assertContains($localFile, $zipFile->getListFiles()); $zipFile->close(); } /** * @throws ZipException */ public function testUnpack() { static::assertTrue(mkdir($this->outputDirname, 0755, true)); $zipFile = new ZipFile(); $zipFile->addFromString('../dir/./../../file.txt', 'contents'); $zipFile->extractTo($this->outputDirname); $zipFile->close(); $expectedExtractedFile = $this->outputDirname . '/dir/file.txt'; static::assertTrue(is_file($expectedExtractedFile)); } }