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

ViewSugarpdfTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 42
rs 10
c 1
b 0
f 1
1
<?php
2
3
4
class ViewSugarpdfTest extends PHPUnit_Framework_TestCase{
5
    
6
    
7
     function testViewSugarpdf(){
8
     	error_reporting(E_ERROR | E_WARNING | E_PARSE);
9
     	      	
10
     	//execute the method without request parameters and test if it works. it should output some headers and throw headers output exception.
11
     	try {
12
     		$view = new ViewSugarpdf();
13
     		 
14
     	} catch (Exception $e) {
15
     		$this->assertStringStartsWith('Cannot modify header information',$e->getMessage());
16
     		
17
     	}
18
     	$this->assertEquals(Null,$view);
19
     	
20
     	
21
     	
22
     	//execute the method with request parameters and test if it works.
23
     	$_REQUEST["sugarpdf"] = 'someValue'; 
24
     	$view = new ViewSugarpdf();
25
     	$view->module = "Users";
26
     	$this->assertInstanceOf('ViewSugarpdf',$view);
27
     	$this->assertInstanceOf('SugarView',$view);
28
     	$this->assertAttributeEquals('sugarpdf','type', $view);
29
     	$this->assertAttributeEquals('someValue','sugarpdf', $view);
30
     	$this->assertAttributeEquals(NULL,'sugarpdfBean', $view);
31
     	
32
     }
33
34
   
35
    //Incomplete test. SugarpdfFactory::loadSugarpdf throws fatal error. error needs to be resolved before testing.     
36
    function testpreDisplay(){
37
    	$this->markTestIncomplete('Can Not be implemented');
38
     }
39
     
40
    //Incomplete test.  SugarpdfFactory::loadSugarpdf throws fatal error. error needs to be resolved before testing.
41
    function testdisplay(){
42
    	$this->markTestIncomplete('Can Not be implemented');
43
     }
44
45
}
46
?>
47