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

ViewPopupTest::testdisplay()   B

Complexity

Conditions 2
Paths 2

Size

Total Lines 25
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 25
rs 8.8571
c 1
b 0
f 1
cc 2
eloc 12
nc 2
nop 0
1
<?php
2
3
class ViewPopupTest 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...
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);
0 ignored issues
show
Unused Code Comprehensibility introduced by
42% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

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