/** * @param PlaceholderAbstract $placeholder * @return void */ public function addCustomPlaceholder(PlaceholderAbstract $placeholder) { if (!empty($this->adapter)) { $placeholder->setQuotePerformer($this->adapter); } $this->placeholders->addPlaceholder($placeholder); }
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()); }