Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Unit/DomainTest.php
Show First 20 Lines • Show All 113 Lines • ▼ Show 20 Lines | class DomainTest extends TestCase | ||||
{ | { | ||||
$domain = new Domain([ | $domain = new Domain([ | ||||
'namespace' => 'test.com', | 'namespace' => 'test.com', | ||||
'status' => Domain::STATUS_NEW, | 'status' => Domain::STATUS_NEW, | ||||
]); | ]); | ||||
$hash_code = $domain->hash(); | $hash_code = $domain->hash(); | ||||
$this->assertRegExp('/^[a-f0-9]{32}$/', $hash_code); | $this->assertMatchesRegularExpression('/^[a-f0-9]{32}$/', $hash_code); | ||||
$hash_text = $domain->hash(Domain::HASH_TEXT); | $hash_text = $domain->hash(Domain::HASH_TEXT); | ||||
$this->assertRegExp('/^kolab-verify=[a-f0-9]{32}$/', $hash_text); | $this->assertMatchesRegularExpression('/^kolab-verify=[a-f0-9]{32}$/', $hash_text); | ||||
$this->assertSame($hash_code, str_replace('kolab-verify=', '', $hash_text)); | $this->assertSame($hash_code, str_replace('kolab-verify=', '', $hash_text)); | ||||
$hash_cname = $domain->hash(Domain::HASH_CNAME); | $hash_cname = $domain->hash(Domain::HASH_CNAME); | ||||
$this->assertSame('kolab-verify', $hash_cname); | $this->assertSame('kolab-verify', $hash_cname); | ||||
$hash_code2 = $domain->hash(Domain::HASH_CODE); | $hash_code2 = $domain->hash(Domain::HASH_CODE); | ||||
$this->assertSame($hash_code, $hash_code2); | $this->assertSame($hash_code, $hash_code2); | ||||
} | } | ||||
} | } |