PopTest\Archive\ZipTest::testZipExtract PHP Method

testZipExtract() public method

public testZipExtract ( )
    public function testZipExtract()
    {
        if (class_exists('ZipArchive', false)) {
            $a = new Archive(__DIR__ . '/../tmp/test.zip');
            $a->addFiles(__DIR__ . '/../tmp');
            mkdir(__DIR__ . '/../tmp/test');
            chmod(__DIR__ . '/../tmp/test', 0777);
            chmod(__DIR__ . '/../tmp/test.zip', 0777);
            $a->extract(__DIR__ . '/../tmp/test');
            unset($a);
            $dir = new Dir(__DIR__ . '/../tmp/test');
            $this->assertGreaterThan(0, count($dir->getFiles()));
            $dir->emptyDir();
            rmdir(__DIR__ . '/../tmp/test');
            if (file_exists(__DIR__ . '/../tmp/test.zip')) {
                unlink(__DIR__ . '/../tmp/test.zip');
            }
        }
    }