New test case for one-one relation fetching.
This commit is contained in:
parent
1e2b0bf67b
commit
cab7c8ea45
@ -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;
|
||||
|
@ -36,7 +36,7 @@ class EventListenerTest extends Doctrine_Record {
|
||||
$this->hasColumn("password", "string", 8);
|
||||
}
|
||||
public function setUp() {
|
||||
$this->attribute(Doctrine::ATTR_LISTENER, new Doctrine_EventListener_AccessorInvoker());
|
||||
//$this->attribute(Doctrine::ATTR_LISTENER, new Doctrine_EventListener_AccessorInvoker());
|
||||
}
|
||||
public function getName($name) {
|
||||
return strtoupper($name);
|
||||
|
@ -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());
|
||||
|
Loading…
x
Reference in New Issue
Block a user