Chumper\Zipper\Zipper::contains PHP Method

contains() public method

Checks if a file is present in the archive
public contains ( $fileInArchive ) : boolean
$fileInArchive
return boolean
    public function contains($fileInArchive)
    {
        return $this->repository->fileExists($fileInArchive);
    }

Usage Example

示例#1
0
 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'));
 }
All Usage Examples Of Chumper\Zipper\Zipper::contains