1
0
Fork 0
mirror of synced 2024-07-05 22:51:24 +12:00
appwrite/tests/unit/Network/Validators/CNAMETest.php
2022-08-01 12:22:04 +02:00

30 lines
763 B
PHP

<?php
namespace Tests\Unit\Network\Validators;
use Appwrite\Network\Validator\CNAME;
use PHPUnit\Framework\TestCase;
class CNAMETest extends TestCase
{
protected ?CNAME $object = null;
public function setUp(): void
{
$this->object = new CNAME('appwrite.io');
}
public function tearDown(): void
{
}
public function testValues(): void
{
$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('cname-unit-test.appwrite.org'), true);
$this->assertEquals($this->object->isValid('test1.appwrite.org'), false);
}
}