/** * Checks whether we are allowed to specify the primary key on a * table with allowPkInsert=true set * * saves the object, gets it from data-source again and then compares * them for equality (thus the instance pool is also checked) */ public function testAllowPkInsertOnIdMethodNativeTable() { CustomerTableMap::doDeleteAll(); $cu = new Customer(); $cu->setPrimaryKey(100000); $cu->save(); $this->assertEquals(100000, $cu->getPrimaryKey()); $cu2 = CustomerQuery::create()->findPk(100000); $this->assertSame($cu, $cu2); }
/** * Checks wether we are allowed to specify the primary key on a * table with allowPkInsert=true set * * saves the object, gets it from data-source again and then compares * them for equality (thus the instance pool is also checked) */ public function testAllowPkInsertOnIdMethodNativeTable() { CustomerPeer::doDeleteAll(); $cu = new Customer(); $cu->setPrimaryKey(100000); $cu->save(); $this->assertEquals(100000, $cu->getPrimaryKey()); $cu2 = CustomerPeer::retrieveByPk(100000); $this->assertSame($cu, $cu2); }