@@ -3,22 +3,22 @@ |
||
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 | } |
@@ -15,10 +15,10 @@ |
||
15 | 15 | $renderedContent = ob_get_contents(); |
16 | 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 | } |
@@ -2,31 +2,31 @@ |
||
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 | ?> |
@@ -8,8 +8,8 @@ discard block |
||
8 | 8 | //execute the contructor and check for the Object type and options attribute |
9 | 9 | $view = new ViewModulelistmenu(); |
10 | 10 | |
11 | - $this->assertInstanceOf('ViewModulelistmenu',$view); |
|
12 | - $this->assertInstanceOf('SugarView',$view); |
|
11 | + $this->assertInstanceOf('ViewModulelistmenu', $view); |
|
12 | + $this->assertInstanceOf('SugarView', $view); |
|
13 | 13 | $this->assertTrue(is_array($view->options)); |
14 | 14 | |
15 | 15 | } |
@@ -25,8 +25,8 @@ discard block |
||
25 | 25 | $renderedContent = ob_get_contents(); |
26 | 26 | ob_end_clean(); |
27 | 27 | |
28 | - $this->assertGreaterThan(0,strlen($renderedContent)); |
|
29 | - $this->assertEquals(false,is_array($renderedContent)); |
|
28 | + $this->assertGreaterThan(0, strlen($renderedContent)); |
|
29 | + $this->assertEquals(false, is_array($renderedContent)); |
|
30 | 30 | } |
31 | 31 | } |
32 | 32 | ?> |
@@ -4,25 +4,25 @@ |
||
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 | ?> |
@@ -16,13 +16,13 @@ |
||
16 | 16 | try { |
17 | 17 | $view->display(); |
18 | 18 | |
19 | - } catch (Exception $e) { |
|
20 | - $this->assertStringStartsWith('Cannot modify header information',$e->getMessage()); |
|
19 | + }catch (Exception $e) { |
|
20 | + $this->assertStringStartsWith('Cannot modify header information', $e->getMessage()); |
|
21 | 21 | } |
22 | 22 | |
23 | - $this->assertInstanceOf('ViewVcard',$view); |
|
24 | - $this->assertInstanceOf('SugarView',$view); |
|
25 | - $this->assertAttributeEquals('detail','type', $view); |
|
23 | + $this->assertInstanceOf('ViewVcard', $view); |
|
24 | + $this->assertInstanceOf('SugarView', $view); |
|
25 | + $this->assertAttributeEquals('detail', 'type', $view); |
|
26 | 26 | } |
27 | 27 | } |
28 | 28 | ?> |
@@ -5,64 +5,64 @@ |
||
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 | } |
@@ -9,17 +9,17 @@ discard block |
||
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 |
||
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 |
||
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 |
@@ -5,61 +5,61 @@ |
||
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 |
@@ -8,21 +8,21 @@ discard block |
||
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 |
||
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 |
||
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 |
@@ -39,8 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | try{ |
41 | 41 | $view->bean = new Account(); |
42 | - } |
|
43 | - Catch(Exception $e){ |
|
42 | + } Catch(Exception $e){ |
|
44 | 43 | $this->assertStringStartsWith('mysqli_query()',$e->getMessage()); |
45 | 44 | } |
46 | 45 | |
@@ -56,8 +55,7 @@ discard block |
||
56 | 55 | $this->assertGreaterThan(0,strlen($renderedContent)); |
57 | 56 | $this->assertNotEquals(False,json_decode($renderedContent)); |
58 | 57 | |
59 | - } |
|
60 | - Catch(Exception $e){ |
|
58 | + } Catch(Exception $e){ |
|
61 | 59 | $this->assertStringStartsWith('mysqli_query()',$e->getMessage()); |
62 | 60 | } |
63 | 61 |
@@ -3,13 +3,13 @@ |
||
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 | } |
@@ -7,9 +7,9 @@ |
||
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 | } |
@@ -3,35 +3,35 @@ |
||
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 | ?> |
@@ -3,16 +3,16 @@ discard block |
||
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 |
||
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 |
@@ -2,39 +2,39 @@ |
||
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 | } |
@@ -1,20 +1,20 @@ discard block |
||
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 |
||
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 |
||
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 | } |
@@ -1,45 +1,45 @@ discard block |
||
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 |
||
51 | 51 | $this->assertGreaterThan(0,strlen($renderedContent)); |
52 | 52 | */ |
53 | 53 | |
54 | - } |
|
55 | - } |
|
54 | + } |
|
55 | + } |
|
56 | 56 | ?> |
@@ -1,18 +1,18 @@ discard block |
||
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 |
||
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 |
||
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. |