1
0
Fork 0
mirror of synced 2024-07-05 06:31:08 +12:00
appwrite/tests/unit/Storage/Validators/FileNameTest.php

33 lines
792 B
PHP
Raw Normal View History

2019-12-27 06:25:59 +13:00
<?php
namespace Appwrite\Tests;
use Appwrite\Storage\Validators\FileName;
2019-12-27 06:25:59 +13:00
use PHPUnit\Framework\TestCase;
class FileNameTest extends TestCase
{
/**
* @var FileName
*/
protected $object = null;
public function setUp()
{
$this->object = new FileName();
}
public function tearDown()
{
}
public function testValues()
{
$this->assertEquals($this->object->isValid(''), false);
$this->assertEquals($this->object->isValid(null), false);
$this->assertEquals($this->object->isValid(false), false);
$this->assertEquals($this->object->isValid('../test'), false);
$this->assertEquals($this->object->isValid('test.png'), true);
$this->assertEquals($this->object->isValid('test'), true);
}
}