Esempio n. 1
0
 function testAggregatedObjectFieldsAreCheckedForDirtinessOnSaveOnly()
 {
     $name = new NameForAggregateTest();
     $name->setFirst('name');
     $member = new MemberForTest();
     $member->setName($name);
     $member->save();
     $member2 = new MemberForTest($member->getId());
     $this->assertFalse($member->isDirty());
     $member2->getName()->setFirst('other name');
     $this->assertFalse($member2->isDirty());
     $member2->save();
     $member3 = new MemberForTest($member->getId());
     $this->assertEqual($member3->getName()->getFirst(), 'other name');
 }
 function testAggregatedObjectAreImportedProperly()
 {
     $name = new NameForAggregateTest();
     $name->setFirst($first = 'first_name');
     $name->setLast($last = 'last_name');
     $member = new MemberForTest();
     $member->setName($name);
     $member->save();
     $member2 = new MemberForTest($member->export());
     $this->assertEqual($member->getName()->getFirst(), $first);
     $this->assertEqual($member->getName()->getLast(), $last);
 }