. */ /** * 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.org * @since 1.0 * @version $Revision$ */ class Doctrine_CustomPrimaryKey_TestCase extends Doctrine_UnitTestCase { public function prepareData() { } public function prepareTables() { $this->tables = array('CustomPK'); parent::prepareTables(); } public function testOperations() { $c = new CustomPK(); $this->assertTrue($c instanceof Doctrine_Entity); $c->name = 'custom pk test'; $this->assertEqual($c->identifier(), array()); $c->save(); $this->assertEqual($c->identifier(), array('uid' => 1)); $this->connection->clear(); $c = $this->connection->getRepository('CustomPK')->find(1); $this->assertEqual($c->identifier(), array('uid' => 1)); } }