2 class Bug37917Test extends Sugar_PHPUnit_Framework_TestCase {
7 SugarTestMergeUtilities::setupFiles(array('Contacts'), array('editviewdefs'), 'tests/modules/UpgradeWizard/SugarMerge/od_metadata_files');
12 SugarTestMergeUtilities::teardownFiles();
16 function test_contacts_editview_merge() {
17 require_once 'modules/UpgradeWizard/SugarMerge/EditViewMerge.php';
18 $this->merge = new EditViewMerge();
19 $this->merge->merge('Contacts', 'tests/modules/UpgradeWizard/SugarMerge/metadata_files/551/modules/Contacts/metadata/editviewdefs.php', 'modules/Contacts/metadata/editviewdefs.php', 'custom/modules/Contacts/metadata/editviewdefs.php');
20 $this->assertTrue(file_exists('custom/modules/Contacts/metadata/editviewdefs.php.suback.php'));
21 require('custom/modules/Contacts/metadata/editviewdefs.php');
25 //echo var_export($viewdefs['Contacts']['EditView']['panels'], true);
26 foreach($viewdefs['Contacts']['EditView']['panels'] as $panel_key=>$panel) {
27 $panels[$panel_key] = $panel_key;
28 foreach($panel as $r=>$row) {
30 foreach($row as $col_key=>$col) {
31 $id = is_array($col) && isset($col['name']) ? $col['name'] : $col;
32 if(!empty($id) && !is_array($id)) {
39 $this->assertTrue(isset($fields['alt_address_postalcode']) && isset($fields['alt_address_city']), 'Assert that alt_address_postalcode and alt_address_city are preserved');
40 $this->assertTrue(isset($fields['alt_address_street']) && !isset($fields['alt_address_street']['displayParams']), 'Assert that the original alt_address_street field contents were preserved');
41 $this->assertTrue(isset($fields['primary_address_postalcode']) && isset($fields['primary_address_city']), 'Assert that primary_address_postalcode and primary_address_city are preserved');
42 $this->assertTrue(isset($fields['primary_address_street']) && !isset($fields['primary_address_street']['displayParams']), 'Assert that the original primary_address_street field contents were preserved');