'6'); private $sfr; public function setUp() { global $locale, $current_user; SugarTestHelper::setUp('current_user', array(true)); $current_user->setPreference('dec_sep', '.'); $current_user->setPreference('num_grp_sep', ','); $current_user->setPreference('default_currency_significant_digits', 2); get_number_seperators(true); parent::setUp(); //if locale is not defined, create new global locale object. if(empty($locale)) { require_once('include/Localization/Localization.php'); $locale = new Localization(); } //create a new SugarFieldCurrency object $this->sfr = new SugarFieldCurrency('currency'); } public function testFormatPrecision() { //lets test some values with different decimals to make sure the formatting is returned correctly $testVal1 = $this->sfr->formatField($this->value1, $this->vardef); $testVal2 = $this->sfr->formatField($this->value2, $this->vardef); $this->assertSame($this->expectedValue, $testVal1,' The currency precision was not formatted correctly.'); $this->assertSame($this->expectedValue, $testVal2,' The currency precision was not formatted correctly.'); } public function tearDown() { SugarTestHelper::tearDown(); get_number_seperators(true); } }