示例#1
0
 public function testPrimaryKeyPersistAfterSave_Bug57()
 {
     $object = DomainObject::create(array('value' => 'llama'));
     $this->assertEquals(1, $object->id);
     $found = DomainObject::byId(1);
     $found->value = 'alpaca';
     $found->save();
     $this->assertEquals(1, $found->id);
 }
示例#2
0
 public function testDecimalTypesAreMarshalledCorrectInLocale()
 {
     $prevLocale = setlocale(LC_ALL, '');
     /**
      * Locale with decimal_point = ","
      * So a float 88.5 becomes 88,5.
      */
     setlocale(LC_ALL, 'nl_NL');
     $object = new DomainObject(array('type' => 'Llama', 'weight' => 88.5));
     $object->save();
     $llamaById = DomainObject::byId(1);
     $this->assertSame($llamaById->weight, 88.5);
     setlocale(LC_ALL, $prevLocale);
 }