Completed
Push — CI ( ee6bd7...0f01dd )
by Adam
22:32
created
tests/tests/include/MVC/View/views/view.noaccessTest.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -3,22 +3,22 @@
 block discarded – undo
3 3
 class ViewNoaccessTest extends PHPUnit_Framework_TestCase
4 4
 {
5 5
 
6
-	public function testdisplay()
7
-	{
8
-		//executet the method and check for default attributes and check that it returns some html.
9
-		$view = new ViewNoaccess();
6
+    public function testdisplay()
7
+    {
8
+        //executet the method and check for default attributes and check that it returns some html.
9
+        $view = new ViewNoaccess();
10 10
 	
11
-		ob_start();
11
+        ob_start();
12 12
 		
13
-		$view->display();
13
+        $view->display();
14 14
 		
15
-		$renderedContent = ob_get_contents();
16
-		ob_end_clean();
15
+        $renderedContent = ob_get_contents();
16
+        ob_end_clean();
17 17
 		
18
-		$this->assertAttributeEquals('noaccess','type', $view);
19
-		$this->assertGreaterThan(0,strlen($renderedContent));
18
+        $this->assertAttributeEquals('noaccess','type', $view);
19
+        $this->assertGreaterThan(0,strlen($renderedContent));
20 20
 		
21
-		$this->assertEquals(False,json_decode($renderedContent)); //check that it doesn't return json.
21
+        $this->assertEquals(False,json_decode($renderedContent)); //check that it doesn't return json.
22 22
 
23
- 	}
23
+        }
24 24
 }
Please login to merge, or discard this patch.
tests/tests/include/MVC/View/views/view.modulelistmenuTest.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -2,31 +2,31 @@
 block discarded – undo
2 2
 
3 3
 class ViewModulelistmenuTest extends PHPUnit_Framework_TestCase
4 4
 {
5
- 	public function test__construct()
6
- 	{
5
+        public function test__construct()
6
+        {
7 7
  
8
- 		//execute the contructor and check for the Object type and options attribute
9
- 		$view = new ViewModulelistmenu();
8
+            //execute the contructor and check for the Object type and options attribute
9
+            $view = new ViewModulelistmenu();
10 10
  			
11
- 		$this->assertInstanceOf('ViewModulelistmenu',$view);
12
- 		$this->assertInstanceOf('SugarView',$view);
13
- 		$this->assertTrue(is_array($view->options)); 		
11
+            $this->assertInstanceOf('ViewModulelistmenu',$view);
12
+            $this->assertInstanceOf('SugarView',$view);
13
+            $this->assertTrue(is_array($view->options)); 		
14 14
  		
15
- 	}	
15
+        }	
16 16
  	
17
- 	public function testdisplay()
18
- 	{
19
- 		//execute the method with required child objects preset. it should return some html. 
20
- 		$view = new ViewModulelistmenu();
21
- 		$view->ss = new Sugar_Smarty();
17
+        public function testdisplay()
18
+        {
19
+            //execute the method with required child objects preset. it should return some html. 
20
+            $view = new ViewModulelistmenu();
21
+            $view->ss = new Sugar_Smarty();
22 22
  		
23
- 		ob_start();
24
- 		$view->display();
25
- 		$renderedContent = ob_get_contents();
26
- 		ob_end_clean();
23
+            ob_start();
24
+            $view->display();
25
+            $renderedContent = ob_get_contents();
26
+            ob_end_clean();
27 27
 
28
- 		$this->assertGreaterThan(0,strlen($renderedContent));
29
- 		$this->assertEquals(false,is_array($renderedContent));
30
- 	}
28
+            $this->assertGreaterThan(0,strlen($renderedContent));
29
+            $this->assertEquals(false,is_array($renderedContent));
30
+        }
31 31
 }
32 32
 ?>
Please login to merge, or discard this patch.
tests/tests/include/MVC/View/views/view.vcardTest.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -4,25 +4,25 @@
 block discarded – undo
4 4
 class ViewVcardTest extends PHPUnit_Framework_TestCase
5 5
 {
6 6
 
7
-	public function testdisplay()
7
+    public function testdisplay()
8 8
     {
9
-    	//execute the method with required child objects preset and check for the Object type and type attribute
9
+        //execute the method with required child objects preset and check for the Object type and type attribute
10 10
   
11
-    	$view = new ViewVcard();
12
-		$view->module = "Contacts";
13
-		$view->bean = new Contact();
11
+        $view = new ViewVcard();
12
+        $view->module = "Contacts";
13
+        $view->bean = new Contact();
14 14
 		
15
-    	//execute the method and test if it works and does not throws an exception other than headers output exception.
16
-    	try {
17
-    		$view->display();
15
+        //execute the method and test if it works and does not throws an exception other than headers output exception.
16
+        try {
17
+            $view->display();
18 18
     			
19
-    	} catch (Exception $e) {
20
-    		$this->assertStringStartsWith('Cannot modify header information',$e->getMessage());
21
-    	}
19
+        } catch (Exception $e) {
20
+            $this->assertStringStartsWith('Cannot modify header information',$e->getMessage());
21
+        }
22 22
     	
23
-    	$this->assertInstanceOf('ViewVcard',$view);
24
-    	$this->assertInstanceOf('SugarView',$view);
25
-    	$this->assertAttributeEquals('detail','type', $view);
26
- 	}
23
+        $this->assertInstanceOf('ViewVcard',$view);
24
+        $this->assertInstanceOf('SugarView',$view);
25
+        $this->assertAttributeEquals('detail','type', $view);
26
+        }
27 27
 }
28 28
 ?>
Please login to merge, or discard this patch.
tests/tests/include/MVC/View/views/view.classicTest.php 1 patch
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -5,64 +5,64 @@
 block discarded – undo
5 5
 
6 6
     public function test__construct( )
7 7
     {
8
-    	//execute the contructor and check for the Object type and type attribute
8
+        //execute the contructor and check for the Object type and type attribute
9 9
     	
10
-    	//test with no paramerters
11
-    	$view = new ViewClassic();
12
-    	$this->assertInstanceOf('ViewClassic',$view);
13
-    	$this->assertInstanceOf('SugarView',$view);
14
-    	$this->assertAttributeEquals('','type', $view);
10
+        //test with no paramerters
11
+        $view = new ViewClassic();
12
+        $this->assertInstanceOf('ViewClassic',$view);
13
+        $this->assertInstanceOf('SugarView',$view);
14
+        $this->assertAttributeEquals('','type', $view);
15 15
 
16 16
     	
17
-    	//test with bean parameter;
18
-    	$bean = new User();
19
-    	$view = new ViewClassic($bean);
20
-    	$this->assertInstanceOf('ViewClassic',$view);
21
-    	$this->assertInstanceOf('SugarView',$view);
22
-    	$this->assertAttributeEquals('','type', $view);
17
+        //test with bean parameter;
18
+        $bean = new User();
19
+        $view = new ViewClassic($bean);
20
+        $this->assertInstanceOf('ViewClassic',$view);
21
+        $this->assertInstanceOf('SugarView',$view);
22
+        $this->assertAttributeEquals('','type', $view);
23 23
     		
24
- 	}
24
+        }
25 25
  	
26 26
 
27 27
     public function testdisplay()
28 28
     {
29
-    	error_reporting(E_ERROR | E_PARSE);
29
+        error_reporting(E_ERROR | E_PARSE);
30 30
 
31 31
     	
32
-    	//test with a valid module but invalid action. it should return false.
33
-    	$view = new ViewClassic();
34
-    	$view->module = "Home";
35
-    	$view->action = "";	 
36
-    	$ret = $view->display();
37
-    	$this->assertFalse($ret);
32
+        //test with a valid module but invalid action. it should return false.
33
+        $view = new ViewClassic();
34
+        $view->module = "Home";
35
+        $view->action = "";	 
36
+        $ret = $view->display();
37
+        $this->assertFalse($ret);
38 38
     	
39 39
 
40 40
     	
41
-    	//test with a valid module and uncustomized action. it should return true
42
-    	$view = new ViewClassic();
43
-    	$view->module = "Home";
44
-    	$view->action = "About";
41
+        //test with a valid module and uncustomized action. it should return true
42
+        $view = new ViewClassic();
43
+        $view->module = "Home";
44
+        $view->action = "About";
45 45
     	
46
-    	ob_start();
47
-    	$ret = $view->display();
48
-    	$renderedContent = ob_get_contents();
49
-    	ob_end_clean();
50
-    	$this->assertGreaterThan(0,strlen($renderedContent));
51
-    	$this->assertTrue($ret);
46
+        ob_start();
47
+        $ret = $view->display();
48
+        $renderedContent = ob_get_contents();
49
+        ob_end_clean();
50
+        $this->assertGreaterThan(0,strlen($renderedContent));
51
+        $this->assertTrue($ret);
52 52
     
53 53
     	
54 54
     	
55
-    	//test with a valid module and customized action. it should return true
56
-    	$view = new ViewClassic();
57
-    	$view->module = "Home";
58
-    	$view->action = "index";
55
+        //test with a valid module and customized action. it should return true
56
+        $view = new ViewClassic();
57
+        $view->module = "Home";
58
+        $view->action = "index";
59 59
 
60
-    	ob_start();
61
-    	$ret = $view->display();
62
-    	$renderedContent = ob_get_contents();
63
-    	ob_end_clean();
64
-    	$this->assertGreaterThan(0,strlen($renderedContent));
65
-    	$this->assertTrue($ret);
60
+        ob_start();
61
+        $ret = $view->display();
62
+        $renderedContent = ob_get_contents();
63
+        ob_end_clean();
64
+        $this->assertGreaterThan(0,strlen($renderedContent));
65
+        $this->assertTrue($ret);
66 66
     	
67 67
     	
68 68
     }
Please login to merge, or discard this patch.
tests/tests/include/MVC/View/views/view.quickeditTest.php 1 patch
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -5,61 +5,61 @@
 block discarded – undo
5 5
   
6 6
     public function testpreDisplay()
7 7
     {
8
-    	//check without setting any values, it should execute without any issues.
9
-    	$view = new ViewQuickedit();
10
-    	$view->preDisplay();
11
-    	$this->assertEquals(0,count($_REQUEST));
8
+        //check without setting any values, it should execute without any issues.
9
+        $view = new ViewQuickedit();
10
+        $view->preDisplay();
11
+        $this->assertEquals(0,count($_REQUEST));
12 12
     	
13
-    	//check with values preset but without a valid bean id, it sould not change Request parameters
14
-    	$_REQUEST['source_module'] = "Users";
15
-    	$_REQUEST['module']= 'Users';
16
-    	$_REQUEST['record'] = '';
17
-    	$request = $_REQUEST;
13
+        //check with values preset but without a valid bean id, it sould not change Request parameters
14
+        $_REQUEST['source_module'] = "Users";
15
+        $_REQUEST['module']= 'Users';
16
+        $_REQUEST['record'] = '';
17
+        $request = $_REQUEST;
18 18
     	
19
-    	$view->preDisplay();
20
-    	$this->assertSame($request,$_REQUEST);
19
+        $view->preDisplay();
20
+        $this->assertSame($request,$_REQUEST);
21 21
     
22
-    	//check with values preset, it sould set some addiiotnal Request parameters
23
-    	$_REQUEST['record'] = 1;
24
-    	$view->preDisplay();
25
-    	$this->assertNotSame($request,$_REQUEST);
22
+        //check with values preset, it sould set some addiiotnal Request parameters
23
+        $_REQUEST['record'] = 1;
24
+        $view->preDisplay();
25
+        $this->assertNotSame($request,$_REQUEST);
26 26
        	
27 27
     }
28 28
 
29 29
  
30 30
     public function testdisplay()
31 31
     {	    
32
-    	error_reporting(E_ALL);
33
-    	//error_reporting(E_ERROR | E_PARSE |E_NOTICE);
32
+        error_reporting(E_ALL);
33
+        //error_reporting(E_ERROR | E_PARSE |E_NOTICE);
34 34
     	
35
-    	//execute the method with required child objects and paramerers preset. it will rteturn some html.
36
-    	$view = new ViewQuickedit();
37
-    	$_REQUEST['module'] = 'Accounts';
38
-    	$_REQUEST['action'] = 'SubpanelCreates';
35
+        //execute the method with required child objects and paramerers preset. it will rteturn some html.
36
+        $view = new ViewQuickedit();
37
+        $_REQUEST['module'] = 'Accounts';
38
+        $_REQUEST['action'] = 'SubpanelCreates';
39 39
     			
40
-    	try{
41
-    		$view->bean = new Account();
42
-    	}
43
-    	Catch(Exception $e){
44
-    		$this->assertStringStartsWith('mysqli_query()',$e->getMessage());
45
-    	}
40
+        try{
41
+            $view->bean = new Account();
42
+        }
43
+        Catch(Exception $e){
44
+            $this->assertStringStartsWith('mysqli_query()',$e->getMessage());
45
+        }
46 46
 
47 47
     	
48
-    	try{
49
-    		ob_start();
48
+        try{
49
+            ob_start();
50 50
     		
51
-    		$view->display();
51
+            $view->display();
52 52
 
53
-    		$renderedContent = ob_get_contents();
54
-    		ob_end_clean();
53
+            $renderedContent = ob_get_contents();
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
-    	}
60
-    	Catch(Exception $e){
61
-    		$this->assertStringStartsWith('mysqli_query()',$e->getMessage());
62
-    	}   	
59
+        }
60
+        Catch(Exception $e){
61
+            $this->assertStringStartsWith('mysqli_query()',$e->getMessage());
62
+        }   	
63 63
     		
64 64
 
65 65
     	
Please login to merge, or discard this patch.
tests/tests/include/MVC/View/views/view.ajaxTest.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -3,13 +3,13 @@
 block discarded – undo
3 3
 class ViewAjaxTest extends PHPUnit_Framework_TestCase
4 4
 {
5 5
 	
6
- 	public function testViewAjax()
7
- 	{
8
- 		//execute the contructor and check for the Object type and attributes 		
9
- 		$view = new ViewAjax();
10
- 		$this->assertInstanceOf('ViewAjax',$view);
11
- 		$this->assertInstanceOf('SugarView',$view);
12
- 		$this->assertTrue( is_array($view->options));
6
+        public function testViewAjax()
7
+        {
8
+            //execute the contructor and check for the Object type and attributes 		
9
+            $view = new ViewAjax();
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
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -3,35 +3,35 @@
 block discarded – undo
3 3
 
4 4
 class ViewXMLTest extends PHPUnit_Framework_TestCase {
5 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
- 	}
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 14
  	
15
-	function testdisplay(){
15
+    function testdisplay(){
16 16
 		
17
-		//execute the method and check for rexcetions. it should return some html. 
18
-		$view = new ViewXML();
17
+        //execute the method and check for rexcetions. it should return some html. 
18
+        $view = new ViewXML();
19 19
 		
20
-		try {
20
+        try {
21 21
 		
22
-			ob_start();
22
+            ob_start();
23 23
 				
24
-			$view->display();
24
+            $view->display();
25 25
 		
26
-			$renderedContent = ob_get_contents();
27
-			ob_end_clean();
26
+            $renderedContent = ob_get_contents();
27
+            ob_end_clean();
28 28
 		
29
-			$this->assertGreaterThan(0,strlen($renderedContent));
29
+            $this->assertGreaterThan(0,strlen($renderedContent));
30 30
 		
31
-		} catch (Exception $e) {
32
-			$this->fail();
33
-		}
31
+        } catch (Exception $e) {
32
+            $this->fail();
33
+        }
34 34
 		
35
- 	}
35
+        }
36 36
 }
37 37
 ?>
Please login to merge, or discard this patch.
tests/tests/include/MVC/View/views/view.quickTest.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -2,39 +2,39 @@
 block discarded – undo
2 2
 
3 3
 class ViewQuickTest extends PHPUnit_Framework_TestCase{
4 4
 	
5
- 	public function testViewQuick(){
5
+        public function testViewQuick(){
6 6
  		
7
- 		//execute the contructor and check for the Object type and type attribute
7
+            //execute the contructor and check for the Object type and type attribute
8 8
  		
9
- 		$view = new ViewQuick();
9
+            $view = new ViewQuick();
10 10
  		
11
- 		$this->assertInstanceOf('ViewQuick',$view);
12
- 		$this->assertInstanceOf('ViewDetail',$view);
13
- 		$this->assertAttributeEquals('detail','type', $view);
14
- 		$this->assertTrue(is_array($view->options));
15
- 	}
11
+            $this->assertInstanceOf('ViewQuick',$view);
12
+            $this->assertInstanceOf('ViewDetail',$view);
13
+            $this->assertAttributeEquals('detail','type', $view);
14
+            $this->assertTrue(is_array($view->options));
15
+        }
16 16
  	
17
- 	public function testdisplay(){
17
+        public function testdisplay(){
18 18
 
19
- 		$view = new ViewQuick();
19
+            $view = new ViewQuick();
20 20
  		
21
- 		//execute the method with required child objects preset. it will return some html.
22
- 		$view->dv = new DetailView2();
23
- 		$view->dv->ss = new Sugar_Smarty();
24
- 		$view->dv->module = "Users";
25
- 		$view->bean= new User();
26
- 		$view->bean->id =1;
27
- 		$view->dv->setup("Users",$view->bean);
21
+            //execute the method with required child objects preset. it will return some html.
22
+            $view->dv = new DetailView2();
23
+            $view->dv->ss = new Sugar_Smarty();
24
+            $view->dv->module = "Users";
25
+            $view->bean= new User();
26
+            $view->bean->id =1;
27
+            $view->dv->setup("Users",$view->bean);
28 28
  		
29
- 		ob_start();
29
+            ob_start();
30 30
  		
31
- 		$view->display();
31
+            $view->display();
32 32
  		
33
- 		$renderedContent = ob_get_contents();
34
- 		ob_end_clean();
33
+            $renderedContent = ob_get_contents();
34
+            ob_end_clean();
35 35
  		
36
- 		$this->assertGreaterThan(0,strlen($renderedContent));
37
- 		$this->assertNotEquals(False,json_decode($renderedContent));
38
- 	}
36
+            $this->assertGreaterThan(0,strlen($renderedContent));
37
+            $this->assertNotEquals(False,json_decode($renderedContent));
38
+        }
39 39
  	
40 40
 }
Please login to merge, or discard this patch.
tests/tests/include/MVC/View/views/view.multieditTest.php 1 patch
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -1,45 +1,45 @@  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
- 		//execute the contructor and check for the Object type and type attribute
9
- 		$view = new ViewMultiedit();
10
- 		$this->assertInstanceOf('ViewMultiedit',$view);
11
- 		$this->assertInstanceOf('SugarView',$view);
12
- 		$this->assertAttributeEquals('edit','type', $view);
13
- 	}
8
+            //execute the contructor and check for the Object type and type attribute
9
+            $view = new ViewMultiedit();
10
+            $this->assertInstanceOf('ViewMultiedit',$view);
11
+            $this->assertInstanceOf('SugarView',$view);
12
+            $this->assertAttributeEquals('edit','type', $view);
13
+        }
14 14
  	
15
- 	function testdisplay(){
15
+        function testdisplay(){
16 16
 
17 17
 
18
- 		//test without action value and modules list in REQUEST object
19
- 		$view = new ViewMultiedit();
20
- 		ob_start();
21
- 		$view->display();
22
- 		$renderedContent = ob_get_contents();
23
- 		ob_end_clean();
24
- 		$this->assertEquals(0,strlen($renderedContent));
18
+            //test without action value and modules list in REQUEST object
19
+            $view = new ViewMultiedit();
20
+            ob_start();
21
+            $view->display();
22
+            $renderedContent = ob_get_contents();
23
+            ob_end_clean();
24
+            $this->assertEquals(0,strlen($renderedContent));
25 25
  		
26 26
 
27 27
  		
28
- 		//test with valid action value to get link in return
29
- 		$view = new ViewMultiedit();
30
- 		$view->action = 'AjaxFormSave';
31
- 		$view->module = 'Users';
32
- 		$view->bean = new User();
33
- 		$view->bean->id =1;
34
- 		ob_start(); 		
35
- 		$view->display(); 		
36
- 		$renderedContent = ob_get_contents();
37
- 		ob_end_clean(); 		
38
- 		$this->assertGreaterThan(0,strlen($renderedContent));
28
+            //test with valid action value to get link in return
29
+            $view = new ViewMultiedit();
30
+            $view->action = 'AjaxFormSave';
31
+            $view->module = 'Users';
32
+            $view->bean = new User();
33
+            $view->bean->id =1;
34
+            ob_start(); 		
35
+            $view->display(); 		
36
+            $renderedContent = ob_get_contents();
37
+            ob_end_clean(); 		
38
+            $this->assertGreaterThan(0,strlen($renderedContent));
39 39
  			
40 40
  		
41
- 		//Fails with a fatal error, method creates editview without properly setting it up causing fatal errors.
42
- 		/*
41
+            //Fails with a fatal error, method creates editview without properly setting it up causing fatal errors.
42
+            /*
43 43
  		//test only with modules list in REQUEST object
44 44
  		$view = new ViewMultiedit();
45 45
  		$GLOBALS['current_language']= 'en_us';
@@ -51,6 +51,6 @@  discard block
 block discarded – undo
51 51
  		$this->assertGreaterThan(0,strlen($renderedContent));
52 52
  		*/	
53 53
  		
54
- 	}
55
- }
54
+        }
55
+    }
56 56
 ?>
Please login to merge, or discard this patch.