Commit cab7c8ea authored by romanb's avatar romanb

New test case for one-one relation fetching.

parent 1e2b0bf6
......@@ -158,13 +158,12 @@ class Doctrine_CustomResultSetOrder_TestCase extends Doctrine_UnitTestCase {
switch ($category->name) {
case 'First':
// The first category should have 3 boards, right?
// It has only 1! The other two slipped to the 2nd category!
// The first category should have 3 boards
$this->assertEqual(3, $category->Boards->count());
break;
case 'Second':
// The second category should have 1 board, but it got 3 now
// The second category should have 1 board
$this->assertEqual(1, $category->Boards->count());
break;
......
This diff is collapsed.
......@@ -695,9 +695,9 @@ class QueryTest_Entry extends Doctrine_Record
*/
public function setTableDefinition()
{
$this->hasColumn('authorId as authorId', 'integer', 4,
$this->hasColumn('authorId', 'integer', 4,
array('notnull'));
$this->hasColumn('date as date', 'integer', 4,
$this->hasColumn('date', 'integer', 4,
array('notnull'));
}
......@@ -716,7 +716,32 @@ class QueryTest_User extends Doctrine_Record
public function setTableDefinition()
{
$this->hasColumn('username as username', 'string', 50,
array('notnull', 'unique'));
array('notnull'));
$this->hasColumn('visibleRankId', 'integer', 4);
}
/**
* Runtime definition of the relationships to other entities.
*/
public function setUp()
{
$this->hasOne('QueryTest_Rank as visibleRank', 'QueryTest_User.visibleRankId');
}
}
class QueryTest_Rank extends Doctrine_Record
{
/**
* Initializes the table definition.
*/
public function setTableDefinition()
{
$this->hasColumn('title as title', 'string', 100,
array('notnull'));
$this->hasColumn('color as color', 'string', 20,
array('notnull', 'regexp' => '/^[a-zA-Z\-]{3,}|#[0-9a-fA-F]{6}$/D'));
$this->hasColumn('icon as icon', 'string', 50,
array('notnull', 'default' => ' ', 'regexp' => '/^[a-zA-Z0-9_\-]+\.(jpg|gif|png)$/D'));
}
}
......
......@@ -222,7 +222,7 @@ $test->addTestCase(new Doctrine_ColumnAggregationInheritance_TestCase());
$test->addTestCase(new Doctrine_ColumnAlias_TestCase());
$test->addTestCase(new Doctrine_Query_OneToOneFetching_TestCase());
$test->addTestCase(new Doctrine_Cache_Apc_TestCase());
$test->addTestCase(new Doctrine_Cache_Memcache_TestCase());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment