public function DomainStrictTestCase::testDomainStrict in Domain Access 7.3
File
- domain_strict/domain_strict.test, line 23
- Simpletest for Domain Strict.
Class
- DomainStrictTestCase
- @file
Simpletest for Domain Strict.
Code
public function testDomainStrict() {
$account = user_load(1);
$grants = node_access_grants('view', $account);
$this
->assertTrue(!empty($grants['domain_id']), t('User is assigned to the default domain properly.'));
db_delete('domain_editor')
->condition('uid', $account->uid)
->execute();
$count = db_query("SELECT 1 FROM {domain_editor} WHERE uid = 1")
->fetchField();
$this
->assertTrue(empty($count), t('User removed from the primary domain.'));
$grants = node_access_grants('view', $account);
$this
->assertTrue(empty($grants['domain_id']), t('Domain strict revoked rights to the user.'));
}