public function extractTo($path, array $files = array(), $method = Zipper::BLACKLIST)
{
if (!$this->file->exists($path)) {
$this->file->makeDirectory($path, 0755, true);
}
if ($method == Zipper::WHITELIST) {
$this->extractWithWhiteList($path, $files);
} else {
$this->extractWithBlackList($path, $files);
}
}
public function testExtractBlackList() { $this->file->shouldReceive('isFile')->with('foo')->andReturn(true); $this->archive->add('foo'); $this->file->shouldReceive('put')->with(realpath(NULL) . '/foo', 'foo'); $this->archive->extractTo(getcwd(), array(), Zipper::BLACKLIST); //---- $this->file->shouldReceive('isFile')->with('foo')->andReturn(true); $this->archive->folder('foo/bar')->add('foo'); $this->file->shouldReceive('put')->with(realpath(NULL) . '/foo', 'foo/bar/foo'); $this->archive->extractTo(getcwd(), array('foo'), Zipper::BLACKLIST); }