1
0
mirror of synced 2024-12-13 14:56:01 +03:00
doctrine2/tests_old/Ticket/626DTestCase.php
2008-02-08 17:27:54 +00:00

59 lines
1.3 KiB
PHP

<?php
/**
* Doctrine_Ticket_626D_TestCase
*
* @package Doctrine
* @author Tamcy <7am.online@gmail.com>
* @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_Ticket_626D_TestCase extends Doctrine_UnitTestCase
{
public function prepareData()
{ }
public function prepareTables()
{
$this->tables = array('T626D_Student1');
parent::prepareTables();
}
protected function newStudent($cls, $id, $name)
{
$u = new $cls;
$u->id = $id;
$u->name = $name;
$u->save();
return $u;
}
public function testFieldNames()
{
$student1 = $this->newStudent('T626D_Student1', '07090002', 'First Student');
try {
$student = $this->conn->getMapper('T626D_Student1')->find('07090002');
$this->pass();
} catch (Exception $e) {
$this->fail($e->__toString());
}
}
}
class T626D_Student1 extends Doctrine_Record
{
public static function initMetadata($class)
{
$class->setTableName('T626D_Student_record_1');
$class->setColumn('s_id as id', 'varchar', 30, array ( 'primary' => true,));
$class->setColumn('s_name as name', 'varchar', 50, array ());
}
}