Completed
Push — CI ( ee6bd7...0f01dd )
by Adam
22:32
created

ViewSugarpdfTest::testdisplay()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 3
rs 10
c 1
b 0
f 1
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
4
class ViewSugarpdfTest extends PHPUnit_Framework_TestCase{
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
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