public function testForeignKey()
 {
     $t6 = new Table6();
     $t6->setTitle('foo');
     $t6->save();
     $t8 = new Table8();
     $t8->setIdentifier(1);
     $t8->setTable6($t6);
     $t8->save();
     $this->assertEquals($t8->getFooId(), $t6->getId(), 'Auto added pkeys can be used in relations');
     $t8->delete();
     $t6->delete();
 }
示例#2
0
 public function testInstancePool()
 {
     $object = new Table6();
     $object->setTitle('test');
     $object->save();
     $key = $object->getId();
     $this->assertSame($object, Table6TableMap::getInstanceFromPool($key));
     Table6TableMap::removeInstanceFromPool($object);
     $this->assertNull(Table6TableMap::getInstanceFromPool($key));
     $object = Table6Query::create()->findPk($key);
     $this->assertSame($object, Table6TableMap::getInstanceFromPool($key));
 }