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