@@ 35-42 (lines=8) @@ | ||
32 | * |
|
33 | * @dataProvider provideComparator |
|
34 | */ |
|
35 | public function testComparator(string $type, string $expectedOperator) |
|
36 | { |
|
37 | $this->visitor->dispatch(Query::comparison($type, 'title', 42)); |
|
38 | $query = $this->queryBuilder; |
|
39 | $children = $query->getChildrenOfType(AbstractNode::NT_WHERE); |
|
40 | $children = $children[0]->getChildrenOfType(AbstractNode::NT_CONSTRAINT); |
|
41 | $this->assertEquals($expectedOperator, $children[0]->getOperator()); |
|
42 | } |
|
43 | ||
44 | public function provideComparator() |
|
45 | { |
|
@@ 151-161 (lines=11) @@ | ||
148 | /** |
|
149 | * It should process "empty" composites. |
|
150 | */ |
|
151 | public function testVisitEmptyComposite() |
|
152 | { |
|
153 | $this->visitor->dispatch( |
|
154 | Query::composite('and') |
|
155 | ); |
|
156 | ||
157 | $query = $this->queryBuilder; |
|
158 | $children = $query->getChildrenOfType(AbstractNode::NT_WHERE); |
|
159 | $children = $children[0]->getChildrenOfType(AbstractNode::NT_CONSTRAINT); |
|
160 | $this->assertInstanceOf(ConstraintAndx::class, $children[0]); |
|
161 | } |
|
162 | ||
163 | /** |
|
164 | * It should visit and composites. |