Remove a file or array of files and folders from the zip archive
public remove ( $fileToRemove ) | ||
$fileToRemove | array|string The path/array to the files in the zip |
public function testRemove() { $this->file->shouldReceive('isFile')->with('foo')->andReturn(true); $this->archive->add('foo'); $this->assertTrue($this->archive->contains('foo')); $this->archive->remove('foo'); $this->assertFalse($this->archive->contains('foo')); //---- $this->file->shouldReceive('isFile')->with('foo')->andReturn(true); $this->file->shouldReceive('isFile')->with('fooBar')->andReturn(true); $this->archive->add(array('foo', 'fooBar')); $this->assertTrue($this->archive->contains('foo')); $this->assertTrue($this->archive->contains('fooBar')); $this->archive->remove(array('foo', 'fooBar')); $this->assertFalse($this->archive->contains('foo')); $this->assertFalse($this->archive->contains('fooBar')); }
/** * Remove a file or array of files and folders from the zip archive * * @param $fileToRemove array|string The path/array to the files in the zip * @return $this Zipper instance * @static */ public static function remove($fileToRemove) { return \Chumper\Zipper\Zipper::remove($fileToRemove); }