1
0
Fork 0
mirror of synced 2024-07-01 04:30:59 +12:00
appwrite/tests/unit/Network/Validators/CNAMETest.php
2020-03-24 19:56:32 +02:00

34 lines
908 B
PHP

<?php
namespace Appwrite\Tests;
use Appwrite\Network\Validators\CNAME;
use PHPUnit\Framework\TestCase;
class CNAMETest extends TestCase
{
/**
* @var CNAME
*/
protected $object = null;
public function setUp()
{
$this->object = new CNAME('appwrite.io');
}
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('test1.appwrite.io'), true);
$this->assertEquals($this->object->isValid('test1.appwrite.io'), true);
$this->assertEquals($this->object->isValid('test1.appwrite.org'), false);
$this->assertEquals($this->object->isValid('test1.appwrite.org'), false);
}
}