public function testEmptyValues()
{
$a = ['types' => [1 => $v = ['id' => 1, 'string' => '', 'notype' => '', 'date' => '', 'datetime' => '', 'time' => '', 'boolean' => '', 'integer' => '', 'money' => '', 'float' => '', 'array' => '', 'object' => '']]];
$this->setDB($a);
date_default_timezone_set('Asia/Seoul');
$db = new Persistence_SQL($this->db->connection);
$m = new Model($db, ['table' => 'types']);
$m->addField('string', ['type' => 'string']);
$m->addField('notype');
$m->addField('date', ['type' => 'date']);
$m->addField('datetime', ['type' => 'datetime']);
$m->addField('time', ['type' => 'time']);
$m->addField('boolean', ['type' => 'boolean']);
$m->addField('integer', ['type' => 'integer']);
$m->addField('money', ['type' => 'money']);
$m->addField('float', ['type' => 'float']);
$m->addField('array', ['type' => 'array']);
$m->addField('object', ['type' => 'object']);
$m->load(1);
// Only
$this->assertSame('', $m['string']);
$this->assertSame('', $m['notype']);
$this->assertSame(null, $m['date']);
$this->assertSame(null, $m['datetime']);
$this->assertSame(null, $m['time']);
$this->assertSame(null, $m['boolean']);
$this->assertSame(null, $m['integer']);
$this->assertSame(null, $m['money']);
$this->assertSame(null, $m['float']);
$this->assertSame(null, $m['array']);
$this->assertSame(null, $m['object']);
unset($v['id']);
$m->set($v);
$this->assertSame('', $m['string']);
$this->assertSame('', $m['notype']);
$this->assertSame(null, $m['date']);
$this->assertSame(null, $m['datetime']);
$this->assertSame(null, $m['time']);
$this->assertSame(null, $m['boolean']);
$this->assertSame(null, $m['integer']);
$this->assertSame(null, $m['money']);
$this->assertSame(null, $m['float']);
$this->assertSame(null, $m['array']);
$this->assertSame(null, $m['object']);
$this->assertEquals([], $m->dirty);
$m->save();
$this->assertEquals($a, $this->getDB());
$m->duplicate()->save();
$a['types'][2] = ['id' => 2, 'string' => '', 'notype' => '', 'date' => null, 'datetime' => null, 'time' => null, 'boolean' => null, 'integer' => null, 'money' => null, 'float' => null, 'array' => null, 'object' => null];
$this->assertEquals($a, $this->getDB());
}