opportunity = new Opportunity(); $this->opportunity->currency_id = -99; $this->opportunity->save(); } /** * Tears down the fixture, for example, close a network connection. * This method is called after a test is executed. * * Removes temporary opportunity */ public function tearDown() { if (!empty($this->opportunity)) { $this->opportunity->mark_deleted($this->opportunity->id); } SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); unset($GLOBALS['current_user']); } /** * Tests that currency-related properties are filled in at model layer * even when opportunity currency is the default one. */ public function testDefaultCurrencyFieldsArePopulated() { $opportunity = new Opportunity(); // disable row level security just to simplify the test $opportunity->disable_row_level_security = true; $opportunity->retrieve($this->opportunity->id); $this->assertNotEmpty($opportunity->currency_name); $this->assertNotEmpty($opportunity->currency_symbol); } }