Ejemplo n.º 1
0
 /**
  * @param Select $select
  * @param RequestQueryInterface $query
  * @param string $conditionType
  * @return Select
  */
 public function addMatchQuery(Select $select, RequestQueryInterface $query, $conditionType)
 {
     $container = $this->matchContainerFactory->create(['request' => $query, 'conditionType' => $conditionType]);
     $name = self::DERIVED_QUERY_PREFIX . count($this->queries);
     $this->queries[$name] = $container;
     return $select;
 }
Ejemplo n.º 2
0
 public function testGetDerivedQueries()
 {
     $this->matchContainerFactory->expects($this->once())->method('create')->willReturn('asdf');
     $result = $this->queryContainer->addMatchQuery($this->select, $this->requestQuery, Bool::QUERY_CONDITION_MUST);
     $this->assertEquals($this->select, $result);
     $queries = $this->queryContainer->getDerivedQueries();
     $this->assertCount(1, $queries);
     $this->assertEquals('asdf', reset($queries));
 }