1 | <?php |
||
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 |