]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - tests/modules/DynamicFields/URLFieldTest.php
Added unit tests.
[Github/sugarcrm.git] / tests / modules / DynamicFields / URLFieldTest.php
1 <?php
2 require_once('modules/DynamicFields/FieldCases.php');
3
4 /**
5  * Test cases for URL Field
6  */
7 class URLFieldTest extends Sugar_PHPUnit_Framework_TestCase
8 {
9     private $_modulename = 'Accounts';
10     
11     public function setUp()
12     {
13         $this->field = get_widget('url');
14         $this->field->id = $this->_modulename.'foo_c';
15         $this->field->name = 'foo_c';
16         $this->field->vanme = 'LBL_Foo';
17         $this->field->comments = NULL;
18         $this->field->help = NULL;
19         $this->field->custom_module = $this->_modulename;
20         $this->field->type = 'url';
21         $this->field->len = 255;
22         $this->field->required = 0;
23         $this->field->default_value = NULL;
24         $this->field->date_modified = '2009-09-14 02:23:23';
25         $this->field->deleted = 0;
26         $this->field->audited = 0;
27         $this->field->massupdate = 0;
28         $this->field->duplicate_merge = 0;
29         $this->field->reportable = 1;
30         $this->field->importable = 'true';
31         $this->field->ext1 = NULL;
32         $this->field->ext2 = NULL;
33         $this->field->ext3 = NULL;
34         $this->field->ext4 = NULL;
35     }
36     
37     public function tearDown()
38     {
39     }
40     
41     public function testURLFieldsInVardef()
42     {
43         $this->field->ext4 = '_self';
44         $vardef = $this->field->get_field_def();
45         $this->assertEquals($vardef['link_target'], '_self');
46     }
47 }