]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - tests/data/Bug39780Test.php
Added unit tests.
[Github/sugarcrm.git] / tests / data / Bug39780Test.php
1 <?php
2
3 class Bug39780Test extends Sugar_PHPUnit_Framework_TestCase
4 {
5     protected $contact;
6     
7     public function setUp()
8     {
9         $this->contact = SugarTestContactUtilities::createContact();
10         }
11         
12         public function tearDown()
13         {
14             SugarTestContactUtilities::removeAllCreatedContacts();
15         }
16         
17         // Test unPopulateDefaultValues to make sure it doesn't generate any notices
18     /*
19      * @group bug39780
20      */
21     public function testSugarBeanUnPopulateDefaultValues()
22     {
23         $this->contact->first_name = 'SadekDizzle';
24         $this->contact->field_defs['first_name']['default'] = 'SadekSnizzle';
25         try{
26             $this->contact->unPopulateDefaultValues();
27         }
28         catch(Exception $e){
29             $this->assertTrue(false, "SugarBean->unPopulateDefaultValues is generating a notice/warning/fatal: " .$e->getMessage());
30             return;
31         }
32         
33         $this->assertTrue(true);
34     }
35 }