Пример #1
0
 public function end()
 {
     if ($this->currentFilter instanceof Filter) {
         $this->currentFilter = null;
     } elseif ($this->currentFilter instanceof NestedFilter) {
         $this->currentFilter = $this->currentFilter->getParent();
     }
     return $this;
 }
 public function testNestedFilter()
 {
     $filterMock = $this->getMock('ABK\\QueryBundle\\Filter\\Filter');
     $parentFilterMock = $this->getMock('ABK\\QueryBundle\\Filter\\Filter');
     $subject = new NestedFilter($filterMock);
     $subject->setParent($parentFilterMock);
     $this->assertEquals(Types::STRUCTURE, $subject->getType());
     $this->assertEquals(Names::NESTED_FILTER, $subject->getName());
     $this->assertSame($filterMock, $subject->getFilter());
     $this->assertSame($parentFilterMock, $subject->getParent());
 }