Ejemplo n.º 1
0
 public function testDefault()
 {
     $table6 = Table6TableMap::getTableMap();
     $this->assertEquals(count($table6->getColumns()), 2, 'auto_add_pk adds one column by default');
     $pks = $table6->getPrimaryKeys();
     $this->assertEquals(count($pks), 1, 'auto_add_pk adds a simple primary key by default');
     $pk = array_pop($pks);
     $this->assertEquals($pk->getName(), 'ID', 'auto_add_pk adds an id column by default');
     $this->assertEquals($pk->getType(), 'INTEGER', 'auto_add_pk adds an integer column by default');
     $this->assertTrue($pk->isPrimaryKey(), 'auto_add_pk adds a primary key column by default');
     $this->assertTrue($table6->isUseIdGenerator(), 'auto_add_pk adds an autoIncrement column by default');
 }
Ejemplo n.º 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));
 }