@@ -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 | |
@@ -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 | |
@@ -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,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 | |
@@ -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,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. |
@@ -7,9 +7,9 @@ |
||
| 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 | |
@@ -4,17 +4,17 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -1,18 +1,18 @@ |
||
| 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 |