-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathzmt_ui.test
78 lines (71 loc) · 2.85 KB
/
zmt_ui.test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
/**
* Test case for Zmt UI tests.
*/
class ZmtUiTestCase extends DrupalWebTestCase {
public static function getInfo() {
return array(
'name' => 'Zmt UI Web Test Case',
'description' => 'Test cases for zmt ui functionality.',
'group' => 'Zmt Modules',
);
}
/**
* Enable dependency modules.
*/
public function setUp() {
parent::setUp(array(
'entity',
'zmt_core',
'zmt_server',
'zmt_cos',
'zmt_tenant',
'zmt_domain',
'zmt_account',
'zmt_alias',
'zmt_group',
'zmt_server_ui',
'zmt_cos_ui',
'zmt_tenant_ui',
'zmt_domain_ui',
'zmt_account_ui',
'zmt_alias_ui',
'zmt_group_ui',
'zmt_ui',
));
}
/**
* Test operations is implemented.
*/
public function testZmtUiOperations() {
$user = $this->drupalCreateUser(array('administer zmt'));
$this->drupalLogin($user);
$this->drupalGet('admin/config/system/zmt');
$this->assertResponse(200, t('Zmt admin user can access the zmt configuration page'));
$this->assertTitle(t('Zimbra multi-tenancy settings.'));
$this->assertText(t('Enable debug'));
$this->assertText(t('Item per page'));
$this->assertText(t('Item per pull'));
$user = $this->drupalCreateUser(array('administer any zmt_server'));
$this->drupalLogin($user);
$this->drupalGet('zmt/server/pull');
$this->assertResponse(200, t('Zmt admin user can access the zimbra pull page'));
$this->assertTitle(t('Pull data from Zimbra Server'));
}
/**
* Test entity hooks is implemented.
*/
public function testZmtEntityHooks() {
$this->assertTrue(module_implements('zmt_domain_presave'), t('Implement zmt_domain_presave hook found.'));
$this->assertTrue(module_implements('zmt_domain_delete'), t('Implement zmt_domain_delete hook found.'));
$this->assertTrue(module_implements('zmt_account_delete'), t('Implement zmt_account_delete hook found.'));
$this->assertTrue(module_implements('zmt_alias_presave'), t('Implement zmt_alias_presave hook found.'));
$this->assertTrue(module_implements('zmt_alias_delete'), t('Implement zmt_alias_delete hook found.'));
$this->assertTrue(module_implements('zmt_group_presave'), t('Implement zmt_group_presave hook found.'));
$this->assertTrue(module_implements('zmt_group_delete'), t('Implement zmt_group_delete hook found.'));
$this->assertTrue(module_implements('group_member_presave'), t('Implement group_member_presave hook found.'));
$this->assertTrue(module_implements('zmt_group_member_delete'), t('Implement zmt_group_member_delete hook found.'));
$this->assertTrue(module_implements('batch_update_group_members'), t('Implement batch_update_group_members hook found.'));
$this->assertTrue(module_implements('form_zmt_server_edit_form_alter'), t('Implement form_zmt_server_edit_form_alter hook found.'));
}
}