Completed
Push — CI ( ee6bd7...0f01dd )
by Adam
22:32
created
tests/tests/include/MVC/View/views/view.classicTest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -9,17 +9,17 @@  discard block
 block discarded – undo
9 9
     	
10 10
     	//test with no paramerters
11 11
     	$view = new ViewClassic();
12
-    	$this->assertInstanceOf('ViewClassic',$view);
13
-    	$this->assertInstanceOf('SugarView',$view);
14
-    	$this->assertAttributeEquals('','type', $view);
12
+    	$this->assertInstanceOf('ViewClassic', $view);
13
+    	$this->assertInstanceOf('SugarView', $view);
14
+    	$this->assertAttributeEquals('', 'type', $view);
15 15
 
16 16
     	
17 17
     	//test with bean parameter;
18 18
     	$bean = new User();
19 19
     	$view = new ViewClassic($bean);
20
-    	$this->assertInstanceOf('ViewClassic',$view);
21
-    	$this->assertInstanceOf('SugarView',$view);
22
-    	$this->assertAttributeEquals('','type', $view);
20
+    	$this->assertInstanceOf('ViewClassic', $view);
21
+    	$this->assertInstanceOf('SugarView', $view);
22
+    	$this->assertAttributeEquals('', 'type', $view);
23 23
     		
24 24
  	}
25 25
  	
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     	$ret = $view->display();
48 48
     	$renderedContent = ob_get_contents();
49 49
     	ob_end_clean();
50
-    	$this->assertGreaterThan(0,strlen($renderedContent));
50
+    	$this->assertGreaterThan(0, strlen($renderedContent));
51 51
     	$this->assertTrue($ret);
52 52
     
53 53
     	
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     	$ret = $view->display();
62 62
     	$renderedContent = ob_get_contents();
63 63
     	ob_end_clean();
64
-    	$this->assertGreaterThan(0,strlen($renderedContent));
64
+    	$this->assertGreaterThan(0, strlen($renderedContent));
65 65
     	$this->assertTrue($ret);
66 66
     	
67 67
     	
Please login to merge, or discard this patch.
tests/tests/include/MVC/View/views/view.quickeditTest.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -8,21 +8,21 @@  discard block
 block discarded – undo
8 8
     	//check without setting any values, it should execute without any issues.
9 9
     	$view = new ViewQuickedit();
10 10
     	$view->preDisplay();
11
-    	$this->assertEquals(0,count($_REQUEST));
11
+    	$this->assertEquals(0, count($_REQUEST));
12 12
     	
13 13
     	//check with values preset but without a valid bean id, it sould not change Request parameters
14 14
     	$_REQUEST['source_module'] = "Users";
15
-    	$_REQUEST['module']= 'Users';
15
+    	$_REQUEST['module'] = 'Users';
16 16
     	$_REQUEST['record'] = '';
17 17
     	$request = $_REQUEST;
18 18
     	
19 19
     	$view->preDisplay();
20
-    	$this->assertSame($request,$_REQUEST);
20
+    	$this->assertSame($request, $_REQUEST);
21 21
     
22 22
     	//check with values preset, it sould set some addiiotnal Request parameters
23 23
     	$_REQUEST['record'] = 1;
24 24
     	$view->preDisplay();
25
-    	$this->assertNotSame($request,$_REQUEST);
25
+    	$this->assertNotSame($request, $_REQUEST);
26 26
        	
27 27
     }
28 28
 
@@ -37,15 +37,15 @@  discard block
 block discarded – undo
37 37
     	$_REQUEST['module'] = 'Accounts';
38 38
     	$_REQUEST['action'] = 'SubpanelCreates';
39 39
     			
40
-    	try{
40
+    	try {
41 41
     		$view->bean = new Account();
42 42
     	}
43
-    	Catch(Exception $e){
44
-    		$this->assertStringStartsWith('mysqli_query()',$e->getMessage());
43
+    	Catch (Exception $e) {
44
+    		$this->assertStringStartsWith('mysqli_query()', $e->getMessage());
45 45
     	}
46 46
 
47 47
     	
48
-    	try{
48
+    	try {
49 49
     		ob_start();
50 50
     		
51 51
     		$view->display();
@@ -53,12 +53,12 @@  discard block
 block discarded – undo
53 53
     		$renderedContent = ob_get_contents();
54 54
     		ob_end_clean();
55 55
     		 
56
-    		$this->assertGreaterThan(0,strlen($renderedContent));
57
-    		$this->assertNotEquals(False,json_decode($renderedContent));
56
+    		$this->assertGreaterThan(0, strlen($renderedContent));
57
+    		$this->assertNotEquals(False, json_decode($renderedContent));
58 58
     	
59 59
     	}
60
-    	Catch(Exception $e){
61
-    		$this->assertStringStartsWith('mysqli_query()',$e->getMessage());
60
+    	Catch (Exception $e) {
61
+    		$this->assertStringStartsWith('mysqli_query()', $e->getMessage());
62 62
     	}   	
63 63
     		
64 64
 
Please login to merge, or discard this patch.
tests/tests/include/MVC/View/views/view.ajaxTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,9 +7,9 @@
 block discarded – undo
7 7
  	{
8 8
  		//execute the contructor and check for the Object type and attributes 		
9 9
  		$view = new ViewAjax();
10
- 		$this->assertInstanceOf('ViewAjax',$view);
11
- 		$this->assertInstanceOf('SugarView',$view);
12
- 		$this->assertTrue( is_array($view->options));
10
+ 		$this->assertInstanceOf('ViewAjax', $view);
11
+ 		$this->assertInstanceOf('SugarView', $view);
12
+ 		$this->assertTrue(is_array($view->options));
13 13
  			
14 14
  	}
15 15
 }
Please login to merge, or discard this patch.
tests/tests/include/MVC/View/views/view.xmlTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -3,16 +3,16 @@  discard block
 block discarded – undo
3 3
 
4 4
 class ViewXMLTest extends PHPUnit_Framework_TestCase {
5 5
 	
6
-	function testViewXML(){
6
+	function testViewXML() {
7 7
 		
8 8
 		//execute the contructor and check for the Object type and type attribute
9 9
  		$view = new ViewXML();
10
- 		$this->assertInstanceOf('ViewXML',$view);
11
- 		$this->assertInstanceOf('SugarView',$view);
12
- 		$this->assertAttributeEquals('detail','type', $view);
10
+ 		$this->assertInstanceOf('ViewXML', $view);
11
+ 		$this->assertInstanceOf('SugarView', $view);
12
+ 		$this->assertAttributeEquals('detail', 'type', $view);
13 13
  	}
14 14
  	
15
-	function testdisplay(){
15
+	function testdisplay() {
16 16
 		
17 17
 		//execute the method and check for rexcetions. it should return some html. 
18 18
 		$view = new ViewXML();
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
 			$renderedContent = ob_get_contents();
27 27
 			ob_end_clean();
28 28
 		
29
-			$this->assertGreaterThan(0,strlen($renderedContent));
29
+			$this->assertGreaterThan(0, strlen($renderedContent));
30 30
 		
31
-		} catch (Exception $e) {
31
+		}catch (Exception $e) {
32 32
 			$this->fail();
33 33
 		}
34 34
 		
Please login to merge, or discard this patch.
tests/tests/include/MVC/View/views/view.quickTest.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,20 +1,20 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-class ViewQuickTest extends PHPUnit_Framework_TestCase{
3
+class ViewQuickTest extends PHPUnit_Framework_TestCase {
4 4
 	
5
- 	public function testViewQuick(){
5
+ 	public function testViewQuick() {
6 6
  		
7 7
  		//execute the contructor and check for the Object type and type attribute
8 8
  		
9 9
  		$view = new ViewQuick();
10 10
  		
11
- 		$this->assertInstanceOf('ViewQuick',$view);
12
- 		$this->assertInstanceOf('ViewDetail',$view);
13
- 		$this->assertAttributeEquals('detail','type', $view);
11
+ 		$this->assertInstanceOf('ViewQuick', $view);
12
+ 		$this->assertInstanceOf('ViewDetail', $view);
13
+ 		$this->assertAttributeEquals('detail', 'type', $view);
14 14
  		$this->assertTrue(is_array($view->options));
15 15
  	}
16 16
  	
17
- 	public function testdisplay(){
17
+ 	public function testdisplay() {
18 18
 
19 19
  		$view = new ViewQuick();
20 20
  		
@@ -22,9 +22,9 @@  discard block
 block discarded – undo
22 22
  		$view->dv = new DetailView2();
23 23
  		$view->dv->ss = new Sugar_Smarty();
24 24
  		$view->dv->module = "Users";
25
- 		$view->bean= new User();
26
- 		$view->bean->id =1;
27
- 		$view->dv->setup("Users",$view->bean);
25
+ 		$view->bean = new User();
26
+ 		$view->bean->id = 1;
27
+ 		$view->dv->setup("Users", $view->bean);
28 28
  		
29 29
  		ob_start();
30 30
  		
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
  		$renderedContent = ob_get_contents();
34 34
  		ob_end_clean();
35 35
  		
36
- 		$this->assertGreaterThan(0,strlen($renderedContent));
37
- 		$this->assertNotEquals(False,json_decode($renderedContent));
36
+ 		$this->assertGreaterThan(0, strlen($renderedContent));
37
+ 		$this->assertNotEquals(False, json_decode($renderedContent));
38 38
  	}
39 39
  	
40 40
 }
Please login to merge, or discard this patch.
tests/tests/include/MVC/View/views/view.multieditTest.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 
4
- class ViewMultieditTest  extends PHPUnit_Framework_TestCase{
4
+ class ViewMultieditTest  extends PHPUnit_Framework_TestCase {
5 5
 
6
- 	function testViewMultiedit(){
6
+ 	function testViewMultiedit() {
7 7
  		
8 8
  		//execute the contructor and check for the Object type and type attribute
9 9
  		$view = new ViewMultiedit();
10
- 		$this->assertInstanceOf('ViewMultiedit',$view);
11
- 		$this->assertInstanceOf('SugarView',$view);
12
- 		$this->assertAttributeEquals('edit','type', $view);
10
+ 		$this->assertInstanceOf('ViewMultiedit', $view);
11
+ 		$this->assertInstanceOf('SugarView', $view);
12
+ 		$this->assertAttributeEquals('edit', 'type', $view);
13 13
  	}
14 14
  	
15
- 	function testdisplay(){
15
+ 	function testdisplay() {
16 16
 
17 17
 
18 18
  		//test without action value and modules list in REQUEST object
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
  		$view->display();
22 22
  		$renderedContent = ob_get_contents();
23 23
  		ob_end_clean();
24
- 		$this->assertEquals(0,strlen($renderedContent));
24
+ 		$this->assertEquals(0, strlen($renderedContent));
25 25
  		
26 26
 
27 27
  		
@@ -30,12 +30,12 @@  discard block
 block discarded – undo
30 30
  		$view->action = 'AjaxFormSave';
31 31
  		$view->module = 'Users';
32 32
  		$view->bean = new User();
33
- 		$view->bean->id =1;
33
+ 		$view->bean->id = 1;
34 34
  		ob_start(); 		
35 35
  		$view->display(); 		
36 36
  		$renderedContent = ob_get_contents();
37 37
  		ob_end_clean(); 		
38
- 		$this->assertGreaterThan(0,strlen($renderedContent));
38
+ 		$this->assertGreaterThan(0, strlen($renderedContent));
39 39
  			
40 40
  		
41 41
  		//Fails with a fatal error, method creates editview without properly setting it up causing fatal errors.
Please login to merge, or discard this patch.
tests/tests/include/MVC/View/views/view.importvcardsaveTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,9 +7,9 @@
 block discarded – undo
7 7
     {
8 8
     	//execute the contructor and check for the Object type and type attribute
9 9
     	$view = new ViewImportvcardsave();
10
-    	$this->assertInstanceOf('ViewImportvcardsave',$view);
11
-    	$this->assertInstanceOf('SugarView',$view);
12
-    	$this->assertAttributeEquals('save','type', $view);
10
+    	$this->assertInstanceOf('ViewImportvcardsave', $view);
11
+    	$this->assertInstanceOf('SugarView', $view);
12
+    	$this->assertAttributeEquals('save', 'type', $view);
13 13
     		
14 14
     }
15 15
 
Please login to merge, or discard this patch.
tests/tests/include/MVC/View/views/view.editTest.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -4,17 +4,17 @@  discard block
 block discarded – undo
4 4
  {
5 5
 
6 6
 
7
- 	public function testViewEdit(){
7
+ 	public function testViewEdit() {
8 8
  
9 9
  		//execute the contructor and check for the Object type and attributes
10 10
  		$view = new ViewEdit();
11
- 		$this->assertInstanceOf('ViewEdit',$view);
12
- 		$this->assertInstanceOf('SugarView',$view);
13
- 		$this->assertAttributeEquals('edit','type', $view);
11
+ 		$this->assertInstanceOf('ViewEdit', $view);
12
+ 		$this->assertInstanceOf('SugarView', $view);
13
+ 		$this->assertAttributeEquals('edit', 'type', $view);
14 14
  		
15
- 		$this->assertAttributeEquals(false,'useForSubpanel', $view);
16
- 		$this->assertAttributeEquals(false,'useModuleQuickCreateTemplate', $view);
17
- 		$this->assertAttributeEquals(true,'showTitle', $view);
15
+ 		$this->assertAttributeEquals(false, 'useForSubpanel', $view);
16
+ 		$this->assertAttributeEquals(false, 'useModuleQuickCreateTemplate', $view);
17
+ 		$this->assertAttributeEquals(true, 'showTitle', $view);
18 18
  		
19 19
  	}
20 20
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     	$view->module = "Users";
29 29
     	$view->bean = new User();
30 30
     	$view->preDisplay();
31
-    	$this->assertInstanceOf('EditView',$view->ev);
31
+    	$this->assertInstanceOf('EditView', $view->ev);
32 32
     	
33 33
     	
34 34
     	//execute the method again for a different module with required attributes preset, it will initialize the ev(edit view) attribute.
@@ -36,11 +36,11 @@  discard block
 block discarded – undo
36 36
     	$view->module = "Meetings";
37 37
     	$view->bean = new Meeting();
38 38
     	$view->preDisplay();
39
-    	$this->assertInstanceOf('EditView',$view->ev);
39
+    	$this->assertInstanceOf('EditView', $view->ev);
40 40
     	
41 41
     }
42 42
 
43
- 	public function testdisplay(){
43
+ 	public function testdisplay() {
44 44
 
45 45
  		//execute the method with essential parameters set. it should return some html.
46 46
  		$view = new ViewEdit();
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
  		$view->display();
54 54
  		$renderedContent = ob_get_contents();
55 55
  		ob_end_clean();
56
- 		$this->assertGreaterThan(0,strlen($renderedContent));
56
+ 		$this->assertGreaterThan(0, strlen($renderedContent));
57 57
  		
58 58
  	}
59 59
   
Please login to merge, or discard this patch.
tests/tests/include/MVC/View/views/view.serializedTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-class ViewSerializedTest extends PHPUnit_Framework_TestCase{
3
+class ViewSerializedTest extends PHPUnit_Framework_TestCase {
4 4
 	
5
-	public function testViewSerialized(){
5
+	public function testViewSerialized() {
6 6
 		
7 7
 		//execute the contructor and check for the Object type
8 8
 		$view = new ViewSerialized();
9
-		$this->assertInstanceOf('ViewSerialized',$view);
10
-		$this->assertInstanceOf('SugarView',$view);
9
+		$this->assertInstanceOf('ViewSerialized', $view);
10
+		$this->assertInstanceOf('SugarView', $view);
11 11
 		
12 12
  	}
13 13
  	
14 14
  	//Incomplete Test. method uses exit() so it cannot be tested.
15
-	public function testdisplay(){
15
+	public function testdisplay() {
16 16
 		
17 17
 		
18 18
 		/* //this method call uses exit() so it cannot be tested as it forces the PHP unit to quite as well
Please login to merge, or discard this patch.