Skip to content

Commit 42bc499

Browse files
committed
+ test for lazy incapsulant added
1 parent 0433653 commit 42bc499

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/misc/DAOTest.class.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,30 @@ public function testIpRangeProperty()
826826
$this->drop();
827827
}
828828

829+
public function testLazy()
830+
{
831+
$this->create();
832+
833+
$parent = TestParentObject::create();
834+
$child = TestChildObject::create()->setParent($parent);
835+
836+
$parent->dao()->add($parent);
837+
838+
$child->dao()->add($child);
839+
840+
$this->assertEquals(
841+
$parent->getId(),
842+
Criteria::create(TestChildObject::dao())->
843+
setProjection(
844+
Projection::property('parent.id', 'parentId')
845+
)->
846+
add(Expression::eq('id', $child->getId()))->
847+
getCustom('parentId')
848+
);
849+
850+
$this->drop();
851+
}
852+
829853
protected function getSome()
830854
{
831855
for ($i = 1; $i < 3; ++$i) {

0 commit comments

Comments
 (0)