Ejemplo n.º 1
0
 function testImportActiveRecordWithLazyAttributes()
 {
     $object = new LazyTestOneTableObject();
     $object->setContent($content = 'Some content');
     $object->setAnnotation($annotation = 'Some annotation');
     $object->save();
     $object1 = new LazyTestOneTableObject();
     $object2 = new LazyTestOneTableObject($object->getId());
     $object1->import($object2);
     $this->assertFalse(array_key_exists('annotation', $object1->exportRaw()));
     $this->assertTrue($object1->has('annotation'));
     $this->assertEqual($object1->getAnnotation(), $annotation);
     $this->assertTrue(array_key_exists('annotation', $object1->exportRaw()));
     $this->assertFalse(array_key_exists('content', $object1->exportRaw()));
     $this->assertTrue($object1->has('content'));
     $this->assertEqual($object1->getContent(), $content);
     $this->assertTrue(array_key_exists('content', $object1->exportRaw()));
 }
 protected function _createActiveRecord($annotation, $content)
 {
     $object = new LazyTestOneTableObject();
     $object->setAnnotation($annotation);
     $object->setContent($content);
     $object->save();
     return $object;
 }