]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - tests/modules/ModuleBuilder/Module/StudioModuleTest.php
Added unit tests.
[Github/sugarcrm.git] / tests / modules / ModuleBuilder / Module / StudioModuleTest.php
1 <?php
2
3 require_once("modules/ModuleBuilder/Module/StudioModule.php");
4
5 class StudioModuleTest extends Sugar_PHPUnit_Framework_TestCase
6 {
7         public function setUp()
8     {
9         $beanList = array();
10         $beanFiles = array();
11         require('include/modules.php');
12         $GLOBALS['beanList'] = $beanList;
13         $GLOBALS['beanFiles'] = $beanFiles;
14         $GLOBALS['app_list_strings'] = return_app_list_strings_language($GLOBALS['current_language']);
15
16     }
17     
18     public function tearDown() 
19     {
20         unset($GLOBALS['beanFiles']);
21         unset($GLOBALS['beanList']);
22         unset($GLOBALS['app_list_strings']);
23     }
24
25     /**
26      * @ticket 39407
27      */
28     public function testRemoveFieldFromLayoutsDocumentsException()
29     {
30         $SM = new StudioModule("Documents");
31         try {
32             $SM->removeFieldFromLayouts("aFieldThatDoesntExist");
33             $this->assertTrue(true);
34         } catch (Exception $e)
35         {
36             $this->assertTrue(false, "Studio module threw exception :" . $e->getMessage());
37         }
38     }
39 }