Exemplo n.º 1
0
 /**
  * @param $query
  * @param bool $isForceExpandValues
  * @return Query
  */
 private function transformQuery(Query $query, $isForceExpandValues = false)
 {
     $transformer = new QueryTransformer($this->getAdapter(), $this->placeholders);
     return $transformer->transformQuery($query, $isForceExpandValues);
 }
Exemplo n.º 2
0
 public function testTransformQuery_CustomAdapterCustomPlaceholderWithCommonNativePlaceholderWithoutExpandValueFewValues()
 {
     $myAdapter = Helper::getMockCustomAdapter();
     $placeholders = new PlaceholderCollection();
     $placeholders->addPlaceholder(Helper::getMockCustomPlaceholder('?m'));
     $transformer = new QueryTransformer($myAdapter, $placeholders);
     $result = $transformer->transformQuery(Query::create('SQL_TEXT ?m, ?m SQL_TEXT', ['in1']), false);
     $this->assertEquals('SQL_TEXT ?, ERROR_NO_VALUE SQL_TEXT', $result->getQueryAsText());
     $this->assertSame(['out1'], $result->getValues());
 }