1
0
mirror of synced 2024-12-13 22:56:04 +03:00
doctrine2/tests/CustomPrimaryKeyTestCase.php
zYne 41ee9173f1 method name changes for better custom getter/setter compatibility
Doctrine_Record::getID() -> obtainIdentifier()
Doctrine_Record::setID() -> assignIdentifier()
2006-09-17 17:59:04 +00:00

27 lines
790 B
PHP

<?php
require_once("UnitTestCase.php");
class Doctrine_CustomPrimaryKeyTestCase 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));
}
}
?>