Exemplo n.º 1
0
 public function testAddEntryFullPathPasswd()
 {
     //copy($this->filesDir . '/test.7z', $this->tmpDir . '/test.7z');
     copy($this->filesDir . '/test.txt', $this->tmpDir . '/file.txt');
     $obj = new Archive7z($this->tmpDir . '/test.7z', $this->cliPath);
     $obj->setPassword('111');
     $obj->addEntry(realpath($this->tmpDir . '/file.txt'), false, false);
     $result = $obj->getEntry('file.txt');
     self::assertInstanceOf('Archive7z\\Entry', $result);
     self::assertEquals('file.txt', $result->getPath());
     $new = new Archive7z($this->tmpDir . '/test.7z', $this->cliPath);
     $this->setExpectedException('Archive7z\\Exception');
     $new->getContent('file.txt');
 }
Exemplo n.º 2
0
 public function testChangeSystemLocaleFail()
 {
     $new = new Archive7z($this->tmpDir . '/test.7z', $this->cliPath);
     $new->setChangeSystemLocale(true);
     $this->setExpectedException('Archive7z\\Exception');
     $new->getContent('file.txt');
 }