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

ViewXMLTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 33
rs 10
c 1
b 0
f 1
1
<?php
2
3
4
class ViewXMLTest extends PHPUnit_Framework_TestCase {
5
	
6
	function testViewXML(){
7
		
8
		//execute the contructor and check for the Object type and type attribute
9
 		$view = new ViewXML();
10
 		$this->assertInstanceOf('ViewXML',$view);
11
 		$this->assertInstanceOf('SugarView',$view);
12
 		$this->assertAttributeEquals('detail','type', $view);
13
 	}
14
 	
15
	function testdisplay(){
16
		
17
		//execute the method and check for rexcetions. it should return some html. 
18
		$view = new ViewXML();
19
		
20
		try {
21
		
22
			ob_start();
23
				
24
			$view->display();
25
		
26
			$renderedContent = ob_get_contents();
27
			ob_end_clean();
28
		
29
			$this->assertGreaterThan(0,strlen($renderedContent));
30
		
31
		} catch (Exception $e) {
32
			$this->fail();
33
		}
34
		
35
 	}
36
}
37
?>
38