Implement test for Domain Zone CAA record

This commit is contained in:
Marc-André Kolly
2019-07-28 20:05:55 +02:00
parent be0470aec1
commit e67e2a85de
2 changed files with 26 additions and 2 deletions

View File

@@ -277,6 +277,30 @@ class DomainZonesTest extends TestCase
DomainZones::getLocal($admin_userdata, $data)->add();
}
public function testAdminDomainZonesAddCAA()
{
global $admin_userdata;
$data = [
'domainname' => 'test2.local',
'record' => '@',
'type' => 'CAA',
'content' => '0 issue "letsencrypt.org"'
];
$json_result = DomainZones::getLocal($admin_userdata, $data)->add();
$result = json_decode($json_result, true)['data'];
$this->assertTrue(count($result) > 1);
$found = false;
foreach ($result as $entry) {
if (substr($entry, strlen('0 issue "letsencrypt.org"') * - 1) == '0 issue "letsencrypt.org"') {
$found = true;
break;
}
}
$this->assertTrue($found);
$this->assertEquals('@ 18000 IN CAA 0 issue "letsencrypt.org"', $entry);
}
public function testAdminDomainZonesAddCname()
{
global $admin_userdata;