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

ViewPopupTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 40
rs 10
c 1
b 0
f 1
1
<?php
2
3
class ViewPopupTest extends PHPUnit_Framework_TestCase
4
{
5
6
	public function testViewPopup(){
7
8
		//execute the contructor and check for the Object type and type attribute
9
		$view = new ViewPopup();
10
		$this->assertInstanceOf('ViewPopup',$view);
11
		$this->assertInstanceOf('SugarView',$view);
12
		$this->assertAttributeEquals('list','type', $view);
13
		
14
		unset($view);
15
	}
16
17
	public function testdisplay(){
18
		
19
		//error_reporting(E_ERROR | E_PARSE |E_ALL);
20
		
21
		//execute the method with required child objects preset. it should return some html. 
22
		$view = new ViewPopup();
23
		$view->module = "Accounts";
24
		
25
		try{
26
			$view->bean = new Account();
27
		}
28
		Catch(Exception $e){
29
			$this->assertStringStartsWith('mysqli_query()',$e->getMessage());
30
		}
31
	
32
		ob_start();
33
		
34
		$view->display();
35
		
36
		$renderedContent = ob_get_contents();
37
		ob_end_clean();
38
		
39
		$this->assertGreaterThan(0,strlen($renderedContent));
40
		
41
	}
42
}
43
44