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()); }
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()); }