Added file type tests
This commit is contained in:
parent
a9a9b379dc
commit
83a2f0bebe
3 changed files with 30 additions and 0 deletions
BIN
tests/resources/disk-a/kitten-1.jpg
Normal file
BIN
tests/resources/disk-a/kitten-1.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 586 KiB |
BIN
tests/resources/disk-a/kitten-2.jpg
Normal file
BIN
tests/resources/disk-a/kitten-2.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 129 KiB |
30
tests/unit/Storage/Validators/FileTypeTest.php
Normal file
30
tests/unit/Storage/Validators/FileTypeTest.php
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace Appwrite\Tests;
|
||||
|
||||
use Storage\Validators\FileType;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class FileTypeTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var FileType
|
||||
*/
|
||||
protected $object = null;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->object = new FileType([FileType::FILE_TYPE_JPEG]);
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
public function testValues()
|
||||
{
|
||||
$this->assertEquals($this->object->isValid(__DIR__ . '/../../../resources/disk-a/kitten-1.jpg'), true);
|
||||
$this->assertEquals($this->object->isValid(__DIR__ . '/../../../resources/disk-a/kitten-2.jpg'), true);
|
||||
$this->assertEquals($this->object->isValid(__DIR__ . '/../../../resources/disk-a/kitten-2.jpg'), true);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue