Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: ZIP file extension #127

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Storage/Validator/FileExt.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class FileExt extends Validator

const TYPE_GZIP = 'gz';

const TYPE_ZIP = 'zip';

/**
* @var array
*/
Expand Down
4 changes: 3 additions & 1 deletion tests/Storage/Validator/FileExtTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class FileExtTest extends TestCase

public function setUp(): void
{
$this->object = new FileExt([FileExt::TYPE_GIF, FileExt::TYPE_GZIP]);
$this->object = new FileExt([FileExt::TYPE_GIF, FileExt::TYPE_GZIP, FileExt::TYPE_ZIP]);
}

public function tearDown(): void
Expand All @@ -36,5 +36,7 @@ public function testValues()
$this->assertEquals($this->object->isValid('file.tar.gz'), true);
$this->assertEquals($this->object->isValid('file.gz'), true);
$this->assertEquals($this->object->isValid('file.GIF'), true);
$this->assertEquals($this->object->isValid('file.zip'), true);
$this->assertEquals($this->object->isValid('file.7zip'), false);
}
}