Skip to content

Commit a23ad32

Browse files
committed
Added sub filter test
1 parent 0c27f1b commit a23ad32

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/ExpressionTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ public function testFilter(): void
7575
$filter->reset();
7676
$filter->and('id')->and('age', '>', 22);
7777
$this->assertEquals('id and age > :p9', $filter->compile());
78+
79+
$filter->reset();
80+
$sub = new Filter($factory);
81+
$sub->and('id', '=', 2)->or('id', '=', 5);
82+
$filter->and($sub)->and('age', '>', 22);
83+
$this->assertEquals('(id = :p10 or id = :p11) and age > :p12', $filter->compile());
7884
}
7985

8086
public function testExpression(): void

0 commit comments

Comments
 (0)