Пример #1
0
 /**
  * @return Filter|null
  */
 protected function getCurrentFilter()
 {
     if ($this->currentFilter instanceof Filter) {
         return $this->currentFilter;
     } elseif ($this->currentFilter instanceof NestedFilter) {
         return $this->currentFilter->getFilter();
     } else {
         return null;
     }
 }
 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());
 }