Test Failed
Push — CI ( 0f01dd...c95a04 )
by Adam
55:13
created

AuditTest   A

Complexity

Total Complexity 16

Size/Duplication

Total Lines 165
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 16
lcom 1
cbo 3
dl 0
loc 165
rs 10
c 1
b 0
f 1
1
<?php
2
require_once('modules/Audit/Audit.php');
3
class AuditTest extends PHPUnit_Framework_TestCase  {
4
5
	
6
	public function testAudit() {
7
		
8
		error_reporting(E_ERROR | E_PARSE);
9
		
10
		//execute the contructor and check for the Object type and  attributes
11
		$audit = new Audit();
12
		$this->assertInstanceOf('Audit',$audit);
13
		$this->assertInstanceOf('SugarBean',$audit);
14
		$this->assertAttributeEquals('Audit', 'module_dir', $audit);
15
		$this->assertAttributeEquals('Audit', 'object_name', $audit);
16
17
		
18
	}
19
20
	public function testget_summary_text()
21
	{
22
		$audit = new Audit();
23
		
24
		//test without setting name
25
		$this->assertEquals(Null,$audit->get_summary_text());
26
		
27
		//test with name set
28
		$audit->name = "test";
29
		$this->assertEquals('test',$audit->get_summary_text());
30
		
31
	}
32
33
    public function testcreate_export_query()
34
    {
35
    	$audit = new Audit();
36
    	
37
    	//execute the method and test if it works and does not throws an exception.
38
    	try {
39
    		$audit->create_export_query('', '');
40
    		$this->assertTrue(true);
41
    	}
42
    	catch (Exception $e) {
43
    		$this->fail();
44
    	}
45
    	
46
    	$this->markTestIncomplete('method has no implementation');
47
    }
48
49
	public function testfill_in_additional_list_fields()
50
	{
51
52
		$audit = new Audit();
53
		//execute the method and test if it works and does not throws an exception.
54
		try {
55
			$audit->fill_in_additional_list_fields();
56
			$this->assertTrue(true);
57
		}
58
		catch (Exception $e) {
59
			$this->fail();
60
		}
61
		 
62
		$this->markTestIncomplete('method has no implementation');
63
		
64
	}
65
66
	public function testfill_in_additional_detail_fields()
67
	{
68
69
		$audit = new Audit();
70
		//execute the method and test if it works and does not throws an exception.
71
		try {
72
			$audit->fill_in_additional_detail_fields();
73
			$this->assertTrue(true);
74
		}
75
		catch (Exception $e) {
76
			$this->fail();
77
		}
78
			
79
		$this->markTestIncomplete('method has no implementation');
80
		
81
	}
82
83
	public function testfill_in_additional_parent_fields()
84
	{
85
		$audit = new Audit();
86
		//execute the method and test if it works and does not throws an exception.
87
		try {
88
			$audit->fill_in_additional_parent_fields();
89
			$this->assertTrue(true);
90
		}
91
		catch (Exception $e) {
92
			$this->fail();
93
		}
94
			
95
		$this->markTestIncomplete('method has no implementation');	
96
		
97
	}
98
99
	public function testget_list_view_data()
100
	{
101
102
		$audit = new Audit();
103
		//execute the method and test if it works and does not throws an exception.
104
		try {
105
			$audit->get_list_view_data();
106
			$this->assertTrue(true);
107
		}
108
		catch (Exception $e) {
109
			$this->fail();
110
		}
111
			
112
		$this->markTestIncomplete('method has no implementation');
113
		
114
		
115
    }
116
117
	public function testget_audit_link()
118
	{
119
120
		$audit = new Audit();
121
		//execute the method and test if it works and does not throws an exception.
122
		try {
123
			$audit->get_audit_link();
124
			$this->assertTrue(true);
125
		}
126
		catch (Exception $e) {
127
			$this->fail();
128
		}
129
			
130
		$this->markTestIncomplete('method has no implementation');
131
		
132
	}
133
134
	
135
	public function testget_audit_list()
136
	{
137
		
138
		global $focus;
139
		$focus = new Account(); //use audit enabbled module object
140
		
141
		$audit = new Audit();
142
		
143
		//execute the method and verify that it returns an array
144
		$result = $audit->get_audit_list();
145
	    $this->assertTrue(is_array($result));
146
	    
147
	}
148
149
	public function testgetAssociatedFieldName()
150
	{
151
		global $focus;
152
		$focus = new Account(); //use audit enabbled module object
153
		
154
		$audit = new Audit();
155
		
156
		//test with name field
157
		$result = $audit->getAssociatedFieldName("name","1");
158
		$this->assertEquals("1",$result);
159
		
160
		//test with parent_id field
161
		$result = $audit->getAssociatedFieldName("parent_id","1");
162
		$this->assertEquals(null,$result);
163
	
164
	}
165
	
166
   
167
}
168
?>