customVardefPath = 'custom' . DIRECTORY_SEPARATOR . 'Extension' . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . 'Cases' . DIRECTORY_SEPARATOR . 'Ext' . DIRECTORY_SEPARATOR . 'Vardefs' . DIRECTORY_SEPARATOR . 'sugarfield_resolution46869.php'; $dirname = dirname($this->customVardefPath); if (file_exists($dirname) === false) { mkdir($dirname, 0777, true); } $code = <<customVardefPath, $code); SugarTestHelper::setUp('beanList'); SugarTestHelper::setUp('beanFiles'); SugarTestHelper::setUp('app_strings'); SugarTestHelper::setUp('app_list_strings'); } public function tearDown() { unlink($this->customVardefPath); SugarTestHelper::tearDown(); } public function testLoadingCustomVardef() { $df = new StandardFieldBug46869Test('Cases') ; $df->base_path = dirname($this->customVardefPath); $customDef = $df->loadCustomDefBug46869Test('resolution46869'); $this->assertArrayHasKey('required', $customDef, 'Custom definition of Case::resolution46869 does not have required property.'); } } class StandardFieldBug46869Test extends StandardField { public function loadCustomDefBug46869Test($field) { $this->loadCustomDef($field); return $this->custom_def; } }