bean = new Bug49691bMockBean(); $this->sugarField = new SugarFieldDatetime("Account"); $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser(); } public function tearDown() { unset($GLOBALS['current_user']); SugarTestUserUtilities::removeAllCreatedAnonymousUsers(); unset($this->sugarField); } /** * @dataProvider providerFunction * @return void */ public function testDBDateConversion($dateValue, $expected) { global $current_user; $this->bean->test_c = $dateValue; $this->sugarField->save($this->bean, array('test_c'=>$dateValue),'test_c', null, ''); $this->assertNotEmpty($this->bean->test_c); $this->assertSame($expected, $this->bean->test_c); } public function providerFunction() { return array( array('01/01/2012', '2012-01-01'), array('2012-01-01', '2012-01-01'), ); } } class Bug49691bMockBean { var $test_c; } ?>