. */ /** * Doctrine_CustomPrimaryKey_TestCase * * @package Doctrine * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping * @link www.phpdoctrine.com * @since 1.0 * @version $Revision$ */ class Doctrine_CustomPrimaryKey_TestCase extends Doctrine_UnitTestCase { public function prepareData() { } public function prepareTables() { $this->tables = array("CustomPK"); } public function testOperations() { $c = new CustomPK(); $this->assertTrue($c instanceof Doctrine_Record); $c->name = "custom pk test"; $this->assertEqual($c->obtainIdentifier(), array()); $c->save(); $this->assertEqual($c->obtainIdentifier(), array("uid" => 1)); $this->connection->clear(); $c = $this->connection->getTable('CustomPK')->find(1); $this->assertEqual($c->obtainIdentifier(), array("uid" => 1)); } } ?>