2 require_once 'include/dir_inc.php';
4 class Bug43226Test extends Sugar_PHPUnit_Framework_TestCase {
9 SugarTestMergeUtilities::setupFiles(array('Documents'), array('editviewdefs'), 'tests/modules/UpgradeWizard/SugarMerge/metadata_files');
14 SugarTestMergeUtilities::teardownFiles();
17 function test_uploadfile_convert_merge_600() {
18 require_once 'modules/UpgradeWizard/SugarMerge/EditViewMerge.php';
19 $this->merge = new EditViewMerge();
20 $this->merge->merge('Documents', 'tests/modules/UpgradeWizard/SugarMerge/metadata_files/600/modules/Documents/metadata/editviewdefs.php','modules/Documents/metadata/editviewdefs.php','custom/modules/Documents/metadata/editviewdefs.php');
22 require('custom/modules/Documents/metadata/editviewdefs.php');
27 foreach ( $viewdefs['Documents']['EditView']['panels'] as $panel ) {
28 foreach ( $panel as $row ) {
29 foreach ( $row as $col ) {
30 if ( is_array($col) ) {
31 $fieldName = $col['name'];
36 if ( $fieldName == 'filename' ) {
38 } else if ( $fieldName == 'uploadfile' ) {
45 $this->assertTrue($foundUploadFile==0,'Uploadfile field still exists, should be filename');
46 $this->assertTrue($foundFilename>0,'Filename field doesn\'t exit, it should');
48 if ( file_exists('custom/modules/Documents/metadata/editviewdefs-testback.php') ) {
49 copy('custom/modules/Documents/metadata/editviewdefs-testback.php','custom/modules/Documents/metadata/editviewdefs.php');
50 unlink('custom/modules/Documents/metadata/editviewdefs-testback.php');
54 function test_uploadfile_convert_merge_610() {
55 require_once 'modules/UpgradeWizard/SugarMerge/EditViewMerge.php';
56 $this->merge = new EditViewMerge();
57 $this->merge->merge('Documents', 'tests/modules/UpgradeWizard/SugarMerge/metadata_files/610/modules/Documents/metadata/editviewdefs.php','modules/Documents/metadata/editviewdefs.php','custom/modules/Documents/metadata/editviewdefs.php');
59 require('custom/modules/Documents/metadata/editviewdefs.php');
64 foreach ( $viewdefs['Documents']['EditView']['panels'] as $panel ) {
65 foreach ( $panel as $row ) {
66 foreach ( $row as $col ) {
67 if ( is_array($col) ) {
68 $fieldName = $col['name'];
73 if ( $fieldName == 'filename' ) {
75 } else if ( $fieldName == 'uploadfile' ) {
82 $this->assertTrue($foundUploadFile==0,'Uploadfile field still exists, should be filename');
83 $this->assertTrue($foundFilename>0,'Filename field doesn\'t exit, it should');
85 if ( file_exists('custom/modules/Documents/metadata/editviewdefs-testback.php') ) {
86 copy('custom/modules/Documents/metadata/editviewdefs-testback.php','custom/modules/Documents/metadata/editviewdefs.php');
87 unlink('custom/modules/Documents/metadata/editviewdefs-testback.php');