public function testSynchronizedForeignKeyIsValidIfForeignRelationIsSet()
 {
     $address = new TestAddress();
     $address->synchronizeWithArray(array('Person' => array()));
     $table = $address->getTable();
     $errors = $table->validateField('person_id', $address->person_id, $address);
     $this->assertEqual(0, $errors->count());
 }
Beispiel #2
0
 public function testForeignKeyIsValidIfLocalRelationIsSet()
 {
     $person = new TestPerson();
     $address = new TestAddress();
     $address->Person = $person;
     $table = $address->getTable();
     $errors = $table->validateField('person_id', $address->person_id, $address);
     $this->assertEqual(0, $errors->count());
 }