1 | <?php |
||
10 | class CompositeExpressionTest extends \Doctrine\Tests\DbalTestCase |
||
11 | { |
||
12 | public function testCount() |
||
22 | |||
23 | public function testAdd() |
||
24 | { |
||
25 | $expr = new CompositeExpression(CompositeExpression::TYPE_OR, array('u.group_id = 1')); |
||
26 | |||
27 | $this->assertCount(1, $expr); |
||
28 | |||
29 | $expr->add(new CompositeExpression(CompositeExpression::TYPE_AND, array())); |
||
30 | |||
31 | $this->assertCount(1, $expr); |
||
32 | |||
33 | $expr->add(new CompositeExpression(CompositeExpression::TYPE_OR, array('u.user_id = 1'))); |
||
34 | |||
35 | $this->assertCount(2, $expr); |
||
36 | |||
37 | $expr->add(null); |
||
38 | |||
39 | $this->assertCount(2, $expr); |
||
40 | |||
41 | $expr->add('u.user_id = 1'); |
||
42 | |||
43 | $this->assertCount(3, $expr); |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * @dataProvider provideDataForConvertToString |
||
48 | */ |
||
49 | public function testCompositeUsageAndGeneration($type, $parts, $expects) |
||
55 | |||
56 | public function provideDataForConvertToString() |
||
103 | } |